poliander / cron

Parse and validate crontab expressions in PHP
https://github.com/poliander/cron
GNU General Public License v3.0
63 stars 10 forks source link

Looping with getNext() #4

Closed poliander closed 7 years ago

poliander commented 7 years ago
$t = null;

for ($i = 0; $i < 20; $i++) {
    $c = new \Cron('0 1 * * *');
    echo date('Y-m-d H:i:s', $t = $c->getNext($t)) . "<br />";
}

Expected:

2017-06-04 01:00:00 2017-06-05 01:00:00 ...

Actual:

2017-06-04 01:00:00 2017-06-04 01:00:00 ...

poliander commented 7 years ago

Fixed in 1.2.2