3v4l.org

run code in 500+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/London'); $ts = 1635641999; $t = (new \DateTime())->setTimestamp($ts); echo $t->format('r'), "\n"; echo $t->getTimestamp(), "\n"; echo ($ts === $t->getTimestamp() ? 'correct' : 'incorrect'), "\n\n"; $ts++; $t = (new \DateTime())->setTimestamp($ts); echo $t->format('r'), "\n"; echo $t->getTimestamp(), "\n"; echo ($ts === $t->getTimestamp() ? 'correct' : 'incorrect'), "\n\n";

preferences:
21.68 ms | 474 KiB | 4 Q