3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = "Y-m-d\TH:i:s\.v\Z"; $date = (new \DateTime('2017-04-77T00:00:00.000Z'))->format($format); var_dump($date); var_dump(\DateTime::createFromFormat(DATE_ATOM, '2017-04-21T00:00:00.000Z'));
based on 9kpnK
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2017-04-77T00:00:00.000Z) at position 9 (7): Unexpected character in /in/djbNA:5 Stack trace: #0 /in/djbNA(5): DateTime->__construct('2017-04-77T00:0...') #1 {main} thrown in /in/djbNA on line 5
Process exited with code 255.
Output for hhvm-3.12.14 - 3.17.3
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2017-04-77T00:00:00.000Z) at position 9 (7): Unexpected character' in /in/djbNA:5 Stack trace: #0 /in/djbNA(5): 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 (2017-04-77T00:00:00.000Z) at position 9 (7): Unexpected character' in /in/djbNA:5 Stack trace: #0 /in/djbNA(5): DateTime->__construct('2017-04-77T00:0...') #1 {main} thrown in /in/djbNA on line 5
Process exited with code 255.