3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $Mdcnt = array("0","31","28","31","30","31","30","31","31","30","31","30","31"); for($i=20140329 ; $i<=20140402;$i++){ $year = substr($i,0,4); $mon = intval(substr($i,4,2)); $day = intval(substr($i,6,2)); print $mon . " - " .$day."\n"; if($mon >13 or $mon < 1) break; if($day > $Mdcnt[$mon] or $day < 1) break; $days = sprintf("%04d%02d%02d",$year,$mon,$day); print $days."\n"; } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
3 - 29 20140329 3 - 30 20140330 3 - 31 20140331 3 - 32