3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $offset = ( 720 / 60 ); 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(12) Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /in/L2K3o:7 Stack trace: #0 /in/L2K3o(7): DateTimeZone->__construct('') #1 {main} thrown in /in/L2K3o on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
int(12) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone ()' in /in/L2K3o:7 Stack trace: #0 /in/L2K3o(7): DateTimeZone->__construct() #1 {main}
Process exited with code 255.
Output for 5.2.0 - 5.6.28
int(12) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone ()' in /in/L2K3o:7 Stack trace: #0 /in/L2K3o(7): DateTimeZone->__construct('') #1 {main} thrown in /in/L2K3o on line 7
Process exited with code 255.
Output for 5.0.0 - 5.1.6
int(12) Fatal error: Class 'DateTime' not found in /in/L2K3o on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
int(12) Fatal error: Cannot instantiate non-existent class: datetime in /in/L2K3o on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
int(12) Fatal error: Cannot instantiate non-existent class: datetime in /in/L2K3o on line 5