FG: line 453ff: Error message because $minute isset but is not numeric #80
Error because of PHP 7.x
Just a minor change (affects line 449 in the master branch, 453 in Release 1.2.9), but it is still necessary in the master branch.
Way to reproduce the error:
Error because of PHP 7.x Just a simple change: The code did check whether $hour was set and assumed that $minute is treated alike, but in PHP 7.x $minute is set and empty but not numeric. To make sure you can multiply its value, you have to do a second check and see if it is numeric.
I guess that will do. I am just not sure about the sequence PHP Versions evaluate if statements, so I tend to do things a bit more step by step.
Anyway: the commit solves the problem. The proposed solution by bbannon is improving the stability as well (in my opinion) but I would additionally ensure that variables cannot in any way have incorrect values (as done in the commit).
In C/C++ I used to asserts, so that I still get a warning log message, if an illegal state is encountered, even if I can recover in the code. I just do not know how to do that in PHP.