3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $monday = new \DateTime('next -1 tuesday'); var_dump($monday);
based on 8nsWX
Output for 7.0.30 - 7.3.0beta1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (next -1 tuesday) at position 0 (n): The timezone could not be found in the database in /in/Qg6t4:3 Stack trace: #0 /in/Qg6t4(3): DateTime->__construct('next -1 tuesday') #1 {main} thrown in /in/Qg6t4 on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (next -1 tuesday) at position 0 (n): The timezone could not be found in the database' in /in/Qg6t4:-1 Stack trace: #0 /in/Qg6t4(-1): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (next -1 tuesday) at position 0 (n): The timezone could not be found in the database' in /in/Qg6t4:3 Stack trace: #0 /in/Qg6t4(3): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (next -1 tuesday) at position 0 (n): The timezone could not be found in the database' in /in/Qg6t4:3 Stack trace: #0 /in/Qg6t4(3): DateTime->__construct('next -1 tuesday') #1 {main} thrown in /in/Qg6t4 on line 3
Process exited with code 255.