3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $weekModifier = 1; $date+3 = 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"; } ?>
based on tCiN1
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.32
Parse error: syntax error, unexpected '=' in /in/FKQUP on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '=' in /in/FKQUP on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/FKQUP on line 5
Process exited with code 255.