3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sunday = new DateTimeImmutable('Sunday'); foreach(new DatePeriod($sunday, new DateInterval('P1D'), 6) as $date) { $dow = $date->format('w'); $weekday = $sunday->add(new DateInterval('P' . $dow . 'D')); printf('%s = %s (%s)' . PHP_EOL, $dow, $weekday->format('l'), $weekday->format('D')); }

preferences:
26.4 ms | 404 KiB | 5 Q