3v4l.org

run code in 500+ PHP versions simultaneously
<?php new \DateTime('21-01');
Output for 8.5.3
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (21-01) at position 0 (2): Unexpected character in /in/Yt4EU:3 Stack trace: #0 /in/Yt4EU(3): DateTime->__construct('21-01') #1 {main} thrown in /in/Yt4EU on line 3
Process exited with code 255.
Output for 7.4.33
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (21-01) at position 0 (2): Unexpected character in /in/Yt4EU:3 Stack trace: #0 /in/Yt4EU(3): DateTime->__construct('21-01') #1 {main} thrown in /in/Yt4EU on line 3
Process exited with code 255.

preferences:
159.08 ms | 1092 KiB | 13 Q