3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = date_create('banana'); var_dump($date); $date = new \DateTime('banana'); var_dump($date);
Output for 7.0.0 - 7.2.0
bool(false) Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (banana) at position 0 (b): The timezone could not be found in the database in /in/nG34j:6 Stack trace: #0 /in/nG34j(6): DateTime->__construct('banana') #1 {main} thrown in /in/nG34j on line 6
Process exited with code 255.
Output for 5.4.0 - 5.6.28
bool(false) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (banana) at position 0 (b): The timezone could not be found in the database' in /in/nG34j:6 Stack trace: #0 /in/nG34j(6): DateTime->__construct('banana') #1 {main} thrown in /in/nG34j on line 6
Process exited with code 255.