3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = (new DateTime())->setTime(0,0,30); $ts = strftime('%Y-%m-%d %H:%M:00', $now); $exists = ['jobname/' . $ts => true ]; $timeAhead = 15 * 60 + $now; $jobName = 'jobname'; for ($time = $now; $time < $timeAhead; $time += 60) { $ts = strftime('%Y-%m-%d %H:%M:00', $time); if (!empty($exists[$jobName.'/' . $ts])) { // already scheduled continue; } } echo count($exists);
Output for 7.0.0 - 7.2.0
Warning: strftime() expects parameter 2 to be integer, object given in /in/HoWBh on line 3 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 6 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 10 Warning: strftime() expects parameter 2 to be integer, object given in /in/HoWBh on line 12 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 10 1
Output for 5.4.10 - 5.6.28
Warning: strftime() expects parameter 2 to be long, object given in /in/HoWBh on line 3 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 6 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 10 Warning: strftime() expects parameter 2 to be long, object given in /in/HoWBh on line 12 Notice: Object of class DateTime could not be converted to int in /in/HoWBh on line 10 1
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/HoWBh on line 2
Process exited with code 255.