3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = "2014-05-01"; $b = "2015-04-15"; $i = date("Ym", strtotime($a)); while($i <= date("Ym", strtotime($b))){ echo $i."\n"; if(substr($i, 4, 2) == "12") $i = (date("Y", strtotime($i."01")) + 1)."01"; else $i++; }
based on 482lJ
Output for 4.3.0 - 7.2.0
201405 201406 201407 201408 201409 201410 201411 201412 201501 201502 201503 201504