3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Europe/Prague'); $date = new DateTime('2010-04-25 02:24:16+12:00'); $date->setTimeZone(new \DateTimeZone(date_default_timezone_get())); echo $date->format('H:m:i') . "<br>"; $date = new DateTime('2010-04-25 02:24:16+12:00'); echo $date->format('H:m:i') . "<br>";
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
16:04:24<br>02:04:24<br>
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 16:04:24<br>02:04:24<br>
Output for 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 Fatal error: Class 'DateTime' not found in /in/dl1hE on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 Fatal error: Call to undefined function date_default_timezone_set() in /in/dl1hE on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 Fatal error: Call to undefined function: date_default_timezone_set() in /in/dl1hE on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 Fatal error: Call to undefined function: date_default_timezone_set() in /in/dl1hE on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/dl1hE on line 5 Fatal error: Call to undefined function: date_default_timezone_set() in /in/dl1hE on line 2