3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $minutes = 5; echo (new DateTime('2001-01-01 01:' . (floor($dt->format('i')/$minutes) * $minutes) . ':60'))->format('Y-m-d H:i:s') . "\n"; echo (new DateTime('2001-01-01 01:' . (ceil($dt->format('i')/$minutes) * $minutes) . ':60'))->format('Y-m-d H:i:s') . "\n";
based on mphig
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: dt in /in/vi6kF on line 5 Fatal error: Uncaught Error: Call to a member function format() on null in /in/vi6kF:5 Stack trace: #0 {main} thrown in /in/vi6kF on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: dt in /in/vi6kF on line 5 Fatal error: Uncaught Error: Call to a member function format() on unknown in /in/vi6kF:5 Stack trace: #0 {main} thrown in /in/vi6kF on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: dt in /in/vi6kF on line 5 Fatal error: Call to a member function format() on null in /in/vi6kF on line 5
Process exited with code 255.
Output for 5.4.11 - 5.5.35
Notice: Undefined variable: dt in /in/vi6kF on line 5 Fatal error: Call to a member function format() on a non-object in /in/vi6kF on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/vi6kF on line 5
Process exited with code 255.