3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo (new \DateTime('third week of 2015'))->format('Y-m-d H:i:s');
based on 0YTqf
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (third week of 2015) at position 0 (t): The timezone could not be found in the database in /in/c7gvE:3 Stack trace: #0 /in/c7gvE(3): DateTime->__construct('third week of 2...') #1 {main} thrown in /in/c7gvE 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 (third week of 2015) at position 0 (t): The timezone could not be found in the database' in /in/c7gvE:3 Stack trace: #0 /in/c7gvE(3): DateTime->__construct('third week of 2...') #1 {main} thrown in /in/c7gvE 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/c7gvE on line 3
Process exited with code 255.