3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('2018-10-31'); $date->modify('+60 days'); var_dump($date->format('Y-m-d')); $date2 = new \DateTime('2018-10-31'); $date2->modify('+1 month'); var_dump($date2->format('Y-m-d')); $date2->modify('+1 month'); var_dump($date2->format('Y-m-d'));
based on l3tmX
Output for 5.6.38 - 7.3.0rc3
string(10) "2018-12-30" string(10) "2018-12-01" string(10) "2019-01-01"