3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = date('l'); if($test = "Sunday"){ $end = date('Y-m-d',strtotime('Sunday last week')); $start = date('Y-m-d',strtotime('Monday last week')); }else{ $end = date('Y-m-d',strtotime('Sunday this week')); $start = date('Y-m-d',strtotime('Monday this week')); } echo $start; echo $end;
based on rVqRg
Output for 5.6.23 - 5.6.28, 7.0.8 - 7.2.6
2015-11-302015-12-06
Output for 5.5.0 - 5.6.22, 7.0.0 - 7.0.7
2015-12-072015-12-13