3v4l.org

run code in 200+ php & hhvm versions
<?php $date = new DateTime('2369-12-30'); var_dump($date->format('Y-m-d h:i:s')); $date->add(new DateInterval('P1D')); var_dump($date->format('Y-m-d h:i:s')); echo $date->format('Y-m-d');
based on eiZio
Output for 7.2.6
string(19) "2369-12-30 12:00:00" string(19) "2369-12-31 12:00:00" 2369-12-31
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.1.20
string(19) "2369-12-30 12:00:00" string(19) "2370-01-00 12:00:00" 2370-01-00