3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date_default_timezone_get(); echo "\n\n"; $dateTime = new DateTime('2016-10-29 10:00:00'); // back one hour echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339); echo "\n\n"; $dateTime = new DateTime('2016-03-26 10:00:00'); // forward one hour echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339); echo "\n\n"; $dateTime = new DateTime('2016-05-26 10:00:00'); // no DST change echo $dateTime->format(DateTime::RFC3339); echo "\n"; $dateTime->add(new DateInterval('PT23H')); echo $dateTime->format(DateTime::RFC3339);
based on mj53l
Output for 5.5.8 - 5.5.36, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
Europe/Amsterdam 2016-10-29T10:00:00+02:00 2016-10-30T08:00:00+01:00 2016-03-26T10:00:00+01:00 2016-03-27T09:00:00+02:00 2016-05-26T10:00:00+02:00 2016-05-27T09:00:00+02:00
Output for 5.5.0 - 5.5.7
Europe/Amsterdam 2016-10-29T10:00:00+02:00 2016-10-30T09:00:00+01:00 2016-03-26T10:00:00+01:00 2016-03-27T09:00:00+02:00 2016-05-26T10:00:00+02:00 2016-05-27T09:00:00+02:00