mtdowling / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/
MIT License
4.89k stars 337 forks source link

Fix hanging test on PHP 7 #109

Closed tobias-kuendig closed 8 years ago

tobias-kuendig commented 8 years ago

By cloning the DateTime instance I was able to get all the tests to run on PHP 7. Somehow the setDate method did not change the value of $tdate.

This is not the most beautiful solution but it works. Maybe someone else has an idea why exactly setDate does not change the value and has a better fix for it.

dragonmantank commented 8 years ago

I wonder if there is a small change in the way clone works for PHP 7. At least this fixes it for now. Thanks!