3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('foo bar'); var_dump($dt);
Output for 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (foo bar) at position 0 (f): The timezone could not be found in the database in /in/7Q9WS:3 Stack trace: #0 /in/7Q9WS(3): DateTime->__construct('foo bar') #1 {main} thrown in /in/7Q9WS on line 3
Process exited with code 255.
Output for 8.2.0 - 8.2.27
Fatal error: Uncaught Exception: Failed to parse time string (foo bar) at position 0 (f): The timezone could not be found in the database in /in/7Q9WS:3 Stack trace: #0 /in/7Q9WS(3): DateTime->__construct('foo bar') #1 {main} thrown in /in/7Q9WS on line 3
Process exited with code 255.

preferences:
43.53 ms | 407 KiB | 5 Q