3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $offset = -720; var_dump($offset); $orderdate = new DateTime('2005-10-10'); $timeZoneName = timezone_name_from_abbr("", $offset, 1); $orderdate->setTimezone(new DateTimezone($timeZoneName)); var_dump($orderdate->format('c e T')); $orderdate->setTimezone(new DateTimeZone('CET')); var_dump($orderdate->format('c e T'));
Output for 7.0.0 - 7.1.0
int(-720) Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /in/Fthvt:7 Stack trace: #0 /in/Fthvt(7): DateTimeZone->__construct('') #1 {main} thrown in /in/Fthvt on line 7
Process exited with code 255.
Output for 5.2.0 - 5.6.28
int(-720) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone ()' in /in/Fthvt:7 Stack trace: #0 /in/Fthvt(7): DateTimeZone->__construct('') #1 {main} thrown in /in/Fthvt on line 7
Process exited with code 255.
Output for 5.0.0 - 5.1.6
int(-720) Fatal error: Class 'DateTime' not found in /in/Fthvt on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
int(-720) Fatal error: Cannot instantiate non-existent class: datetime in /in/Fthvt on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
int(-720) Fatal error: Cannot instantiate non-existent class: datetime in /in/Fthvt on line 5