3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cd = new DateTime('2015-03-31'); echo "cd: " . $cd->format( 'Y-m-d' ) . "\n"; $cd->modify('previous month'); echo "cd: " . $cd->format( 'Y-m-d' ) . "\n";
based on mYemW
Output for 5.6.0 - 7.3.0alpha1
cd: 2015-03-31 cd: 2015-03-03