3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt1 = new \DateTime("2015-09-15 01:15-05:30"); echo $dt1->format("Y-m-d\TH:i:s.uZ"); $dt2 = new \DateTime("2015-09-15 01:15-05:30:30"); echo $dt2->format("Y-m-d\TH:i:s.uZ");
based on Aj69N
Output for 7.0.0 - 7.2.0
2015-09-15T01:15:00.000000-19800 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2015-09-15 01:15-05:30:30) at position 22 (:): Unexpected character in /in/f3UUV:6 Stack trace: #0 /in/f3UUV(6): DateTime->__construct('2015-09-15 01:1...') #1 {main} thrown in /in/f3UUV on line 6
Process exited with code 255.
Output for hhvm-3.22.0
2015-09-15T01:15:00.000000-19800 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2015-09-15 01:15-05:30:30) at position 22 (:): Unexpected character' in /in/f3UUV:-1 Stack trace: #0 /in/f3UUV(-1): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1 - 3.21.3
2015-09-15T01:15:00.000000-19800 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2015-09-15 01:15-05:30:30) at position 22 (:): Unexpected character' in /in/f3UUV:6 Stack trace: #0 /in/f3UUV(6): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.4.0 - 5.6.30
2015-09-15T01:15:00.000000-19800 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2015-09-15 01:15-05:30:30) at position 22 (:): Unexpected character' in /in/f3UUV:6 Stack trace: #0 /in/f3UUV(6): DateTime->__construct('2015-09-15 01:1...') #1 {main} thrown in /in/f3UUV on line 6
Process exited with code 255.