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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.13
string(25) "2023-11-27T00:00:00+01:00" string(25) "2023-12-03T00:00:00+01:00"

preferences:
78.31 ms | 406 KiB | 5 Q