3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nextMonday = new \DateTime(date('Y-m-d') . ' previous Monday'); echo $nextMonday->format('Y-m-d') . "\n"; for ($i=1 ; $i<=9 ; ++$i) { $nextMonday->sub(new DateInterval('P7D')); echo $nextMonday->format('Y-m-d') . "\n"; }

preferences:
26.17 ms | 404 KiB | 5 Q