3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = date('l'); $test = 'sd'; 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;

preferences:
44.72 ms | 402 KiB | 5 Q