3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timeZone = (new DateTime('2015-02-15T00:00:00-05:00'))->getTimezone(); $date = (new DateTime('2015-02-26T05:00:00+0000')) ->setTimezone($timeZone) ->format('g:i a'); echo $date;
based on 7LsmC
Output for 5.4.26 - 7.2.0
12:00 am
Output for 5.4.0 - 5.4.25
Warning: DateTime::setTimezone(): Can only do this for zones with ID for now in /in/MHSCu on line 6 Fatal error: Call to a member function format() on a non-object in /in/MHSCu on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/MHSCu on line 3
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_OBJECT_OPERATOR in /in/MHSCu on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/MHSCu on line 3
Process exited with code 255.