3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php$day = 'saturday';$step = 2;$unit = 'W';$start = new DateTime();$end = clone $start;$start->modify($day); // Move to first occurence$end->add(new DateInterval('P1Y')); // Move to 1 year from start$interval = new DateInterval("P{$step}{$unit}");$period = new DatePeriod($start, $interval, $end);foreach ($period as $date) { echo $date->format('D, d M Y'), PHP_EOL;}
based on 0JE61
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '$day' (T_VARIABLE) in /in/AO78a on line 1
Process exited with code 255.