3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = new DateTimeImmutable('2022-02-17T12:00:00 Europe/Paris'); $b = $a->add(new Dateinterval('P12M')); var_Dump($a, $b, (new DateTimezone('Europe/Paris'))->getTransitions($a->getTimestamp(), $b->getTimestamp()));
Output for 8.1.0 - 8.1.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2022-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } array(1) { [0]=> array(5) { ["ts"]=> int(1645095600) ["time"]=> string(24) "2022-02-17T11:00:00+0000" ["offset"]=> int(7200) ["isdst"]=> bool(true) ["abbr"]=> string(4) "CEST" } }
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.6 - 8.1.34
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2022-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } array(3) { [0]=> array(5) { ["ts"]=> int(1645095600) ["time"]=> string(24) "2022-02-17T11:00:00+0000" ["offset"]=> int(3600) ["isdst"]=> bool(false) ["abbr"]=> string(3) "CET" } [1]=> array(5) { ["ts"]=> int(1648342800) ["time"]=> string(24) "2022-03-27T01:00:00+0000" ["offset"]=> int(7200) ["isdst"]=> bool(true) ["abbr"]=> string(4) "CEST" } [2]=> array(5) { ["ts"]=> int(1667091600) ["time"]=> string(24) "2022-10-30T01:00:00+0000" ["offset"]=> int(3600) ["isdst"]=> bool(false) ["abbr"]=> string(3) "CET" } }
Output for 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2022-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2023-02-17 12:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } array(3) { [0]=> array(5) { ["ts"]=> int(1645095600) ["time"]=> string(25) "2022-02-17T11:00:00+00:00" ["offset"]=> int(3600) ["isdst"]=> bool(false) ["abbr"]=> string(3) "CET" } [1]=> array(5) { ["ts"]=> int(1648342800) ["time"]=> string(25) "2022-03-27T01:00:00+00:00" ["offset"]=> int(7200) ["isdst"]=> bool(true) ["abbr"]=> string(4) "CEST" } [2]=> array(5) { ["ts"]=> int(1667091600) ["time"]=> string(25) "2022-10-30T01:00:00+00:00" ["offset"]=> int(3600) ["isdst"]=> bool(false) ["abbr"]=> string(3) "CET" } }

preferences:
39.39 ms | 1151 KiB | 13 Q