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.9k stars 335 forks source link

Not support PHP 7.1.9 #161

Closed vladkireev closed 6 years ago

vladkireev commented 6 years ago

PHP Warning 'yii\base\ErrorException' with message 'A non-numeric value encountered' Stack trace:

0 .../vendor/mtdowling/cron-expression/src/Cron/AbstractField.php(101): yii\base\ErrorHandler->handleError(2, 'A non-numeric v...', '/var/www/telegr...', 101, Array)

1 .../vendor/mtdowling/cron-expression/src/Cron/AbstractField.php(21): Cron\AbstractField->isInIncrementsOfRanges('02', '/5')

#

http://php.net/manual/ru/migration71.other-changes.php

dragonmantank commented 6 years ago

Hello!

Can you let me know which version of the library you are running, and the full cron expression you were using? Thanks!

vladkireev commented 6 years ago

Hello! Version 1.2 Cron expression full : /5

vladkireev commented 6 years ago

Version 1.0 support this version php (1.1 not support)

dragonmantank commented 6 years ago

Unfortunately the 1.x branch is not going to be maintained going forward, unless there is some sort of serious security issue (which I doubt, considering we're just evaluating numbers pretty much).

That being said, the above isn't a valid cron expression. Your minute field will need to provide a range value on the left-hand-side of the /. Most cron programs, and this library, will not default to anything. My guess is you want a * to denote the entire range, but you'll need to supply something there for it to work with.