3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime; $dt->add(new DateInterval('P15M')); echo $dt->format('Y-m-d H:00:00');
Output for 5.6.28, 7.0.12 - 7.1.0
2015-08-05 10:00:00
Output for 7.0.6
2017-08-03 00:00:00
Output for 7.0.5
2017-07-02 14:00:00
Output for 5.3.0 - 5.5.33, 5.6.0 - 5.6.19, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.4
2017-06-12 01:00:00
Output for 5.6.21
2017-08-01 20:00:00
Output for 5.6.20
2017-07-09 09:00:00
Output for 5.5.35
2017-08-21 23:00:00
Output for 5.5.34
2017-07-10 15:00:00
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/GJlhB on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/GJlhB on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/GJlhB on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/GJlhB on line 3