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)); 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 - 7.1.0
20140329 20140330 20140331