3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_format = 'Y-m-d H:i:s'; $day = "Sunday 4 week ago"; date_default_timezone_set("Europe/London"); $date = new DateTime($day); $date->modify('+1 day'); echo $date->format($date_format) . "\n"; date_default_timezone_set("Pacific/Auckland"); $date = new DateTime($day); $date->modify('+1 day'); echo $date->format($date_format) . "\n";
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.5, 7.4.7 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
2019-10-28 00:00:00 2019-10-28 00:00:00
Output for 7.4.6
2019-10-28 00:00:00 2019-10-28 00:00:00 _init has set a custom offset: 1574760380, diff.tv_sec=15138452 diff.tv_usec=682473 gettimeofday using offset: 15138452.692296, returning 1574760380.000100 gettimeofday using offset: 15138452.692296, returning 1574760380.000487 gettimeofday using offset: 15138452.692296, returning 1574760380.000666

preferences:
149.43 ms | 407 KiB | 5 Q