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'));
based on M5Hcu
Output for 7.0.17 - 7.0.33, 7.1.3 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.21, 7.4.0 - 7.4.9, 8.0.0alpha1 - beta1
string(25) "2019-10-31T23:59:59+01:00" string(10) "1572562799" int(1572562799) string(25) "2019-10-31T23:59:59+01:00" string(10) "1572562799"
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) "2019-10-31T23:59:59+01:00" string(10) "1572562799" int(1569967199) string(25) "2019-10-01T23:59:59+02:00" string(10) "1569967199"
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.