3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $minutes = 5; echo (floor(6/$minutes) * $minutes) . "\n"; echo (new DateTime('2001-01-01 01:' . (floor(59/$minutes) * $minutes) . ':60'))->format('Y-m-d H:i:s') . "\n"; echo (new DateTime('2001-01-01 01:' . (ceil(59/$minutes) * $minutes) . ':60'))->format('Y-m-d H:i:s') . "\n";
based on lU3LQ
Output for 7.0.0 - 7.2.0
5 2001-01-01 01:56:00 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2001-01-01 01:60:60) at position 15 (0): Double time specification in /in/DPhCq:8 Stack trace: #0 /in/DPhCq(8): DateTime->__construct('2001-01-01 01:6...') #1 {main} thrown in /in/DPhCq on line 8
Process exited with code 255.
Output for 5.4.11 - 5.6.28
5 2001-01-01 01:56:00 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2001-01-01 01:60:60) at position 15 (0): Double time specification' in /in/DPhCq:8 Stack trace: #0 /in/DPhCq(8): DateTime->__construct('2001-01-01 01:6...') #1 {main} thrown in /in/DPhCq on line 8
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/DPhCq on line 7
Process exited with code 255.