3v4l.org

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