3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo (new \DateTime('last week of 2015'))->format('Y-m-d H:i:s');
based on hbtFr
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (last week of 2015) at position 10 (o): The timezone could not be found in the database in /in/Qh1le:3 Stack trace: #0 /in/Qh1le(3): DateTime->__construct('last week of 20...') #1 {main} thrown in /in/Qh1le on line 3
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (last week of 2015) at position 10 (o): The timezone could not be found in the database' in /in/Qh1le:3 Stack trace: #0 /in/Qh1le(3): DateTime->__construct('last week of 20...') #1 {main} thrown in /in/Qh1le on line 3
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Qh1le on line 3
Process exited with code 255.