3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTimeImmutable('now', new DateTimeZone('Pacific/Midway')); $date2 = new DateTimeImmutable('now', new DateTimeZone('US/Samoa')); echo $date->format(DateTimeInterface::ATOM) . PHP_EOL; echo $date2->format(DateTimeInterface::ATOM) . PHP_EOL; var_dump($date == $date2);
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.26, 8.0.0 - 8.0.13, 8.1rc1 - rc3
2020-08-07T12:16:34-11:00 2020-08-07T12:16:34-11:00 bool(false)

preferences:
52.63 ms | 460 KiB | 5 Q