3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php use DateTime; date_default_timezone_set('EET'); $date = new DateTime(); var_dump($date); $date->setTimezone(new DateTimeZone('EET')); var_dump($date);
Output for 7.1.0
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/bk7tO on line 2 object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 14:15:00.006408" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "EET" } object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 13:15:00.006408" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "EET" }
Output for 5.5.14 - 7.0.14
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/bk7tO on line 2 object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 14:15:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "EET" } object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 13:15:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "EET" }
Output for 5.5.10 - 5.5.13
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/bk7tO on line 2 object(DateTime)#1 (3) { ["date"]=> string(19) "2014-04-29 14:15:00" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "EET" } object(DateTime)#1 (3) { ["date"]=> string(19) "2014-04-29 13:15:00" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "EET" }
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.9
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/bk7tO on line 2 object(DateTime)#1 (3) { ["date"]=> string(19) "2014-04-29 14:15:00" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "EET" } object(DateTime)#1 (3) { ["date"]=> string(19) "2014-04-29 14:15:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.30 - 5.4.45
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/bk7tO on line 2 object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 14:15:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "EET" } object(DateTime)#1 (3) { ["date"]=> string(26) "2014-04-29 14:15:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/bk7tO on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/bk7tO on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_CONSTANT_ENCAPSED_STRING' or `'('' in /in/bk7tO on line 2
Process exited with code 255.