3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ceil300($time,$const) { // function returns timestamp rounded to next 300 seconds ( 5 minutes ) + const if ($time % 300 == 0) return $time + $const; return $time + (300 - ($time % 300)) + $const; } $time = time(); $const = 210; // 210 seconds = 3:30 // getting actual time and constant $act_time = md5(ceil300($time,210)); $lst_time = md5(ceil300($time-300,210)); echo $act_time \n; echo $lst_time;
Output for 5.4.0 - 5.4.10
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting ',' or ';' in /in/tTN01 on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.20
Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting ',' or ';' in /in/tTN01 on line 14
Process exited with code 255.

preferences:
171.65 ms | 1395 KiB | 39 Q