3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($i=0; $i<=12; $i++) { echo '<option value="'.date('Y-m-d', strtotime("-$i month")).'">'.date('Y-m', strtotime("-$i month")).'</option>'; }
based on Qt1hW
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<option value="2014-08-30">2014-08</option><option value="2014-07-30">2014-07</option><option value="2014-06-30">2014-06</option><option value="2014-05-30">2014-05</option><option value="2014-04-30">2014-04</option><option value="2014-03-30">2014-03</option><option value="2014-03-02">2014-03</option><option value="2014-01-30">2014-01</option><option value="2013-12-30">2013-12</option><option value="2013-11-30">2013-11</option><option value="2013-10-30">2013-10</option><option value="2013-09-30">2013-09</option><option value="2013-08-30">2013-08</option>