3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php printf("2013-10-31, -1 month: %s\n" . "2013-10-31, first day of 1 month ago: %s\n" . "2013-10-31, first day 1 month ago: %s\n" . "2013-10-31, first day -1 month: %s", date('m', strtotime('2013-10-31 -1 month')), date('m', strtotime('2013-10-31 first day of 1 month ago')), date('m', strtotime('2013-10-31 first day 1 month ago')), date('m', strtotime('2013-10-31 first day -1 month')));
Output for 5.3.3 - 7.1.0
2013-10-31, -1 month: 10 2013-10-31, first day of 1 month ago: 09 2013-10-31, first day 1 month ago: 09 2013-10-31, first day -1 month: 10
Output for 5.3.0 - 5.3.2
2013-10-31, -1 month: 10 2013-10-31, first day of 1 month ago: 09 2013-10-31, first day 1 month ago: 09 2013-10-31, first day -1 month: 09
Output for 4.3.0 - 5.2.17
2013-10-31, -1 month: 10 2013-10-31, first day of 1 month ago: 01 2013-10-31, first day 1 month ago: 09 2013-10-31, first day -1 month: 10