3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('01-01-2015'); $end = new DateTime('01-06-2015'); $period = new DatePeriod($start, new DateInterval('P1W'), $end); $firstDay = null; $lastDay = null; var_dump(array_pop($period));

preferences:
50.97 ms | 402 KiB | 5 Q