3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = 'saturday'; $step = 2; $unit = 'W'; $start = new DateTime('2012-06-02'); $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, 02 Jun 2012 Sat, 16 Jun 2012 Sat, 30 Jun 2012 Sat, 14 Jul 2012 Sat, 28 Jul 2012 Sat, 11 Aug 2012 Sat, 25 Aug 2012 Sat, 08 Sep 2012 Sat, 22 Sep 2012 Sat, 06 Oct 2012 Sat, 20 Oct 2012 Sat, 03 Nov 2012 Sat, 17 Nov 2012 Sat, 01 Dec 2012 Sat, 15 Dec 2012 Sat, 29 Dec 2012 Sat, 12 Jan 2013 Sat, 26 Jan 2013 Sat, 09 Feb 2013 Sat, 23 Feb 2013 Sat, 09 Mar 2013 Sat, 23 Mar 2013 Sat, 06 Apr 2013 Sat, 20 Apr 2013 Sat, 04 May 2013 Sat, 18 May 2013 Sat, 01 Jun 2013

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:
59.2 ms | 402 KiB | 8 Q