3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2015-04-02 10:00:00'); $date->modify('monday'); echo $date->format('Y-m-d H:i:s');
based on OiOlm
Output for 5.3.6 - 7.2.0
2015-04-06 00:00:00
Output for 5.2.0 - 5.3.5
2015-04-06 10:00:00
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/V46JD 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/V46JD 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/V46JD on line 3