3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 5.6.28, 7.0.14 - 7.1.0
string(25) "2015-08-31T23:59:59+02:00" string(10) "1441058399" int(1438466399) string(25) "2015-08-01T23:59:59+02:00" string(10) "1438466399"
Output for 5.5.24, 5.5.35, 5.6.21, 7.0.6
string(25) "2016-05-31T23:59:59+02:00" string(10) "1464731999" int(1462139999) string(25) "2016-05-01T23:59:59+02:00" string(10) "1462139999"
Output for 5.5.25 - 5.5.30, 5.5.34, 5.6.8 - 5.6.14, 5.6.20, 7.0.5
string(25) "2016-04-30T23:59:59+02:00" string(10) "1462053599" int(1459547999) string(25) "2016-04-01T23:59:59+02:00" string(10) "1459547999"
Output for 5.5.31 - 5.5.33, 5.6.15 - 5.6.19, 7.0.0 - 7.0.4
string(25) "2016-03-31T23:59:59+02:00" string(10) "1459461599" int(1456873199) string(25) "2016-03-01T23:59:59+01:00" string(10) "1456873199"
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/ShFpG on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/ShFpG on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/ShFpG on line 4