3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2012-02-14 +1 day'); echo $date; $day = '14';$month = '02'; if ($day >= date('d')) { echo date('Y-'.$month.'-'.$day); } else { echo date('Y-'.$month.'-'.$day,strtotime("now + 1 month")); }
based on 8vhst
Output for 7.1.0 - 7.3.0beta1
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/aBDpu on line 3
Process exited with code 255.
Output for 5.6.0 - 7.0.20
Catchable fatal error: Object of class DateTime could not be converted to string in /in/aBDpu on line 3
Process exited with code 255.