3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTimeImmutable('2014-05'); $date2 = $date->modify('first day of next month midnight - 1 second'); var_dump($date2->format('U')); var_dump($date2->getTimestamp()); var_dump($date2->format('U'));
based on h6f7C
Output for 5.6.19 - 5.6.28, 7.0.4 - 7.2.0
string(10) "1401573599" int(1401573599) string(10) "1401573599"
Output for 5.5.24 - 5.6.18, 7.0.0 - 7.0.3
string(10) "1401573599" int(1398981599) string(10) "1398981599"
Output for 5.3.17 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/MkrfE on line 3
Process exited with code 255.