3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTimeImmutable(); $monday = $date->modify('monday this week'); $sunday = $date->modify('sunday this week'); var_dump($monday->format(DateTime::ATOM), $sunday->format(DateTime::ATOM));
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(25) "2023-11-27T00:00:00+01:00" string(25) "2023-12-03T00:00:00+01:00"

preferences:
89.04 ms | 402 KiB | 60 Q