3v4l.org

run code in 300+ PHP versions simultaneously
<?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 last week')); } echo $start; echo $end;

preferences:
59.53 ms | 402 KiB | 5 Q