3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = 'saturday'; $step = 2; $unit = 'W'; $start = new DateTime(); $end = clone $start; $start->modify($dow); // 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; }
Output for git.master, git.master_jit, rfc.property-hooks
Sat, 01 Nov 2014 Sat, 15 Nov 2014 Sat, 29 Nov 2014 Sat, 13 Dec 2014 Sat, 27 Dec 2014 Sat, 10 Jan 2015 Sat, 24 Jan 2015 Sat, 07 Feb 2015 Sat, 21 Feb 2015 Sat, 07 Mar 2015 Sat, 21 Mar 2015 Sat, 04 Apr 2015 Sat, 18 Apr 2015 Sat, 02 May 2015 Sat, 16 May 2015 Sat, 30 May 2015 Sat, 13 Jun 2015 Sat, 27 Jun 2015 Sat, 11 Jul 2015 Sat, 25 Jul 2015 Sat, 08 Aug 2015 Sat, 22 Aug 2015 Sat, 05 Sep 2015 Sat, 19 Sep 2015 Sat, 03 Oct 2015 Sat, 17 Oct 2015 Sat, 31 Oct 2015

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.88 ms | 402 KiB | 8 Q