3v4l.org

run code in 300+ PHP versions simultaneously
<?php $monday = new DateTime('this week monday'); $sunday = new DateTime('this week sunday'); $monday->setTime(0, 0, 0); $sunday->setTime(23, 59, 59); $nextMonday = clone $monday; $nextMonday->modify('+1 week'); $nextSunday = clone $sunday; $nextSunday->modify('+1 week'); var_dump( array('monday' => $monday->format('Y-m-d H:i:s'), 'sunday' => $sunday->format('Y-m-d H:i:s'), 'monday' => $nextMonday->format('Y-m-d H:i:s'), 'sunday' => $nextSunday->format('Y-m-d H:i:s')) );

preferences:
47.54 ms | 402 KiB | 5 Q