3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = mktime(0, 0, 0, 1, 31); // midnight Jan 31st $oneMonthLater = mktime(0, 0, 0, date('n', $date) + 1, min(date('t', $date), date('j', $date)), date('Y', $date)); echo date('Y-m-d h:i:s', $oneMonthLater);
Output for 4.3.0 - 7.1.0
2016-03-02 12:00:00