3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = strtotime(date('Y-m').'01'); echo date('Y-m-d',$time); echo '<br>'.$final = date("Y-m-d", strtotime("-1 month", $time));
Output for 4.3.0 - 4.4.9, 5.2.0 - 7.1.0
1970-01-01<br>1969-12-01
Output for 5.1.0 - 5.1.6
2013-08-06<br>2013-07-06
Output for 5.0.0 - 5.0.5
2079-09-01<br>2079-08-01