3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); $date = new DateTime('2015-04-18 22:41:51'); $start = new DateTime("monday this week {$date->format('Y-m-d')}"); $end = new DateTime("monday next week {$date->format('Y-m-d')}"); $end->modify('-1 second'); echo '<pre>'; var_dump($start, $end, date("w")); echo '</pre>';

preferences:
62.31 ms | 402 KiB | 5 Q