3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = time(); echo "Midnight of $d\n"; $date = new DateTime("Midnight of $d"); echo $date;
based on c24m9
Output for 7.0.0 - 7.2.0
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.6.28
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.