3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('day 1 of last month'); echo $date->format('Y-m-d');
based on LEigQ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (day 1 of last month) at position 0 (d): The timezone could not be found in the database in /in/2kARk:2 Stack trace: #0 /in/2kARk(2): DateTime->__construct('day 1 of last m...') #1 {main} thrown in /in/2kARk on line 2
Process exited with code 255.
Output for 5.3.18 - 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (day 1 of last month) at position 0 (d): The timezone could not be found in the database' in /in/2kARk:2 Stack trace: #0 /in/2kARk(2): DateTime->__construct('day 1 of last m...') #1 {main} thrown in /in/2kARk on line 2
Process exited with code 255.