3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=67634 $date = new DateTimeImmutable('first day of next month midnight - 1 second'); var_dump($date->format('c')); var_dump($date->format('U')); var_dump($date->getTimestamp()); var_dump($date->format('c')); var_dump($date->format('U'));
Output for 7.0.17 - 7.0.33, 7.1.3 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(25) "2021-04-30T23:59:59+02:00" string(10) "1619819999" int(1619819999) string(25) "2021-04-30T23:59:59+02:00" string(10) "1619819999"
Output for 7.3.32 - 7.3.33, 8.0.13
string(25) "2021-04-30T23:59:59+00:00" string(10) "1619827199" int(1619827199) string(25) "2021-04-30T23:59:59+00:00" string(10) "1619827199"
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.16, 7.1.0 - 7.1.2
string(25) "2021-04-30T23:59:59+02:00" string(10) "1619819999" int(1617314399) string(25) "2021-04-01T23:59:59+02:00" string(10) "1617314399"
Output for 5.4.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/ShFpG on line 4
Process exited with code 255.

preferences:
301.71 ms | 401 KiB | 383 Q