3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = time(); echo "Midnight of $d\n"; $date = new DateTime("Midnight of $d"); echo $date;
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
Midnight of 1450283154 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (Midnight of 1450283154) at position 9 (o): The timezone could not be found in the database in /in/d2n0J:4 Stack trace: #0 /in/d2n0J(4): DateTime->__construct('Midnight of 145...') #1 {main} thrown in /in/d2n0J on line 4
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Midnight of 1450283154 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Midnight of 1450283154) at position 9 (o): The timezone could not be found in the database' in /in/d2n0J:4 Stack trace: #0 /in/d2n0J(4): DateTime->__construct('Midnight of 145...') #1 {main} thrown in /in/d2n0J on line 4
Process exited with code 255.

preferences:
140.22 ms | 402 KiB | 196 Q