3v4l.org

run code in 300+ PHP versions simultaneously
<?php $m = 1; $y = 2016; foreach (range(1, 31) as $day) { if($day <= 9){ $day = '0'.$day; } // this is the important bit $snap = strtotime("monday this week",strtotime("$m/$day/$y")); echo str_pad('Snapping '.date('l',strtotime("$m/$day/$y")), 18, " ", STR_PAD_LEFT)," $m/$day/$y results: ",date('r',$snap),"\n"; }

preferences:
44.1 ms | 402 KiB | 5 Q