3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $year = '2017'; $month = '11'; $creditCardExpiryDate = new \DateTime('last second of ' . $year . '-' . $month); var_dump($creditCardExpiryDate);
based on Bnmv3
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (last second of 2017-11) at position 12 (o): The timezone could not be found in the database in /in/vrBsJ:4 Stack trace: #0 /in/vrBsJ(4): DateTime->__construct('last second of ...') #1 {main} thrown in /in/vrBsJ on line 4
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 (last second of 2017-11) at position 12 (o): The timezone could not be found in the database' in /in/vrBsJ:-1 Stack trace: #0 /in/vrBsJ(-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 (last second of 2017-11) at position 12 (o): The timezone could not be found in the database' in /in/vrBsJ:4 Stack trace: #0 /in/vrBsJ(4): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (last second of 2017-11) at position 12 (o): The timezone could not be found in the database' in /in/vrBsJ:4 Stack trace: #0 /in/vrBsJ(4): DateTime->__construct('last second of ...') #1 {main} thrown in /in/vrBsJ on line 4
Process exited with code 255.