3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTs = time(); // for testing $startTs = strtotime('05/04/2015'); $baseDay = strtotime('+1 day', $startTs); echo $ts = date('d.m.Y', strtotime('last sunday', $baseDay)); echo PHP_EOL; echo $ts = date('d.m.Y', strtotime('this saturday', $baseDay));

preferences:
35.52 ms | 402 KiB | 5 Q