3v4l.org

run code in 500+ 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:
43.1 ms | 1399 KiB | 5 Q