3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getStartAndEndDate($week, $year) { $dto = new DateTime(); $result[0] = $dto->setISODate($year, $week, 0)->format('Y-m-d'); $result[1] = $dto->setISODate($year, $week, 6)->format('Y-m-d'); return $result; } print_r(getStartAndEndDate(date('W'), 2017));
based on DtUIN
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc2
Array ( [0] => 2017-07-02 [1] => 2017-07-08 )