3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_REQUEST['tzo'] = -420; $orderdate = new DateTime('2005-10-10'); $timeZoneName = timezone_name_from_abbr("", (-intval($_REQUEST['tzo'])/60)*3600, 1); $orderdate->setTimezone(new DateTimezone($timeZoneName)); var_dump($orderdate->format('c e T')); $date->setTimezone(new DateTimeZone('CET')); var_dump($orderdate->format('c e T'));
Output for 7.0.14 - 7.1.0
string(46) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk +07" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Uncaught Error: Call to a member function setTimezone() on null in /in/SnIJo:8 Stack trace: #0 {main} thrown in /in/SnIJo on line 8
Process exited with code 255.
Output for 7.0.5 - 7.0.6
string(48) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk NOVST" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Uncaught Error: Call to a member function setTimezone() on null in /in/SnIJo:8 Stack trace: #0 {main} thrown in /in/SnIJo on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.4
string(48) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk NOVST" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Uncaught Error: Call to a member function setTimezone() on unknown in /in/SnIJo:8 Stack trace: #0 {main} thrown in /in/SnIJo on line 8
Process exited with code 255.
Output for 5.6.28
string(46) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk +07" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Call to a member function setTimezone() on null in /in/SnIJo on line 8
Process exited with code 255.
Output for 5.6.8 - 5.6.21
string(48) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk NOVST" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Call to a member function setTimezone() on null in /in/SnIJo on line 8
Process exited with code 255.
Output for 5.2.0 - 5.5.35
string(48) "2005-10-10T05:00:00+07:00 Asia/Novosibirsk NOVST" Notice: Undefined variable: date in /in/SnIJo on line 8 Fatal error: Call to a member function setTimezone() on a non-object in /in/SnIJo on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/SnIJo on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/SnIJo on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/SnIJo on line 4