3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timeZone = new DateTimeZone('America/Toronto'); $timestamp = '2008-01-01 12:00:00'; $dtobj = DateTime::createFromFormat('Y-m-d H:i:s', $timestamp); $tstmp = $dtobj->getTimestamp(); $timestam2 = '2010-01-01 12:00:00'; $dtob2 = DateTime::createFromFormat('Y-m-d H:i:s', $timestam2); $tstm2 = $dtob2->getTimestamp(); var_dump($tstmp, $tstm2); $transitions = $timeZone->getTransitions($tstmp, $tstm2); var_dump($transitions);
Output for git.master, git.master_jit, rfc.property-hooks
int(1199185200) int(1262343600) array(5) { [0]=> array(5) { ["ts"]=> int(1199185200) ["time"]=> string(25) "2008-01-01T11:00:00+00:00" ["offset"]=> int(-18000) ["isdst"]=> bool(false) ["abbr"]=> string(3) "EST" } [1]=> array(5) { ["ts"]=> int(1205046000) ["time"]=> string(25) "2008-03-09T07:00:00+00:00" ["offset"]=> int(-14400) ["isdst"]=> bool(true) ["abbr"]=> string(3) "EDT" } [2]=> array(5) { ["ts"]=> int(1225605600) ["time"]=> string(25) "2008-11-02T06:00:00+00:00" ["offset"]=> int(-18000) ["isdst"]=> bool(false) ["abbr"]=> string(3) "EST" } [3]=> array(5) { ["ts"]=> int(1236495600) ["time"]=> string(25) "2009-03-08T07:00:00+00:00" ["offset"]=> int(-14400) ["isdst"]=> bool(true) ["abbr"]=> string(3) "EDT" } [4]=> array(5) { ["ts"]=> int(1257055200) ["time"]=> string(25) "2009-11-01T06:00:00+00:00" ["offset"]=> int(-18000) ["isdst"]=> bool(false) ["abbr"]=> string(3) "EST" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.91 ms | 403 KiB | 8 Q