3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $original_timezone = new DateTimeZone('UTC'); $datetime = new DateTime('06-01-2016 19:00 UTC', $original_timezone); $target_timezone = new DateTimeZone('EDT'); $datetime->setTimeZone($target_timezone); $triggerOn = $datetime->format('Y-m-d h:i:s T P'); echo $triggerOn; echo timezone_offset_get($target_timezone,$triggerOn);
based on rdVMU
Output for 7.0.0 - 7.2.0
2016-01-06 02:00:00 EDT -05:00 Fatal error: Uncaught TypeError: Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given in /in/3H8W7:9 Stack trace: #0 /in/3H8W7(9): timezone_offset_get(Object(DateTimeZone), '2016-01-06 02:0...') #1 {main} thrown in /in/3H8W7 on line 9
Process exited with code 255.
Output for 5.5.24 - 5.6.28
2016-01-06 02:00:00 EDT -05:00 Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in /in/3H8W7 on line 9
Output for 5.3.21 - 5.4.45
2016-01-06 02:00:00 EST -05:00 Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in /in/3H8W7 on line 9