3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $weekModifier = -2, $date = new DateTime(); if($date->format('N') !== 1) { $date->sub(new DateInterval('P'. $date->format('N') . 'D')); } $interval = new DateInterval('P'.abs($weekModifier).'W'); if($weekModifier > 0) { $date->add($interval); } else { $date->sub($interval); } for($i = 1; $i <= 7; $i++) { echo $date->add(new DateInterval('P1D'))->format('l Y-m-d') . "<br>\n"; } ?>
Output for 5.3.0 - 5.5.12
Parse error: syntax error, unexpected ',' in /in/AhHQ1 on line 3
Process exited with code 255.