3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date_x = new DateTime('2000-01-0x10'); $date_y = new DateTime('1999-12-31'); $date_z = new DateTime('1999-12-31'); var_dump($date_y == $date_z); var_dump($date_x == $date_y); var_dump('with x', $date_x->format('Y-m-d H:i:sP')); var_dump(' no x', $date_y->format('Y-m-d H:i:sP')); var_dump($date_x); var_dump($date_y);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2000-01-0x10) at position 10 (1): Unexpected character in /in/VVkVM:3 Stack trace: #0 /in/VVkVM(3): DateTime->__construct('2000-01-0x10') #1 {main} thrown in /in/VVkVM on line 3
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2000-01-0x10) at position 10 (1): Unexpected character' in /in/VVkVM:3 Stack trace: #0 /in/VVkVM(3): DateTime->__construct('2000-01-0x10') #1 {main} thrown in /in/VVkVM on line 3
Process exited with code 255.