3v4l.org

run code in 300+ PHP versions simultaneously
<?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'); echo $triggerOn; echo timezone_offset_get($triggerOn);
Output for 8.0.21 - 8.0.30, 8.1.8 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2016-01-06 03:00:00 EDT Fatal error: Uncaught ArgumentCountError: timezone_offset_get() expects exactly 2 arguments, 1 given in /in/DOluB:9 Stack trace: #0 /in/DOluB(9): timezone_offset_get('2016-01-06 03:0...') #1 {main} thrown in /in/DOluB on line 9
Process exited with code 255.
Output for 8.0.0 - 8.0.20, 8.1.0 - 8.1.7
2016-01-06 02:00:00 EDT Fatal error: Uncaught ArgumentCountError: timezone_offset_get() expects exactly 2 arguments, 1 given in /in/DOluB:9 Stack trace: #0 /in/DOluB(9): timezone_offset_get('2016-01-06 02:0...') #1 {main} thrown in /in/DOluB on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
2016-01-06 02:00:00 EDT Fatal error: Uncaught TypeError: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given in /in/DOluB:9 Stack trace: #0 /in/DOluB(9): timezone_offset_get('2016-01-06 02:0...') #1 {main} thrown in /in/DOluB on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
2016-01-06 02:00:00 EDT Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in /in/DOluB on line 9

preferences:
168.35 ms | 402 KiB | 183 Q