3v4l.org

run code in 300+ PHP versions simultaneously
<?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, H:m:s'), PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Sat, 01 Nov 2014, 00:11:00 Sat, 15 Nov 2014, 00:11:00 Sat, 29 Nov 2014, 00:11:00 Sat, 13 Dec 2014, 00:12:00 Sat, 27 Dec 2014, 00:12:00 Sat, 10 Jan 2015, 00:01:00 Sat, 24 Jan 2015, 00:01:00 Sat, 07 Feb 2015, 00:02:00 Sat, 21 Feb 2015, 00:02:00 Sat, 07 Mar 2015, 00:03:00 Sat, 21 Mar 2015, 00:03:00 Sat, 04 Apr 2015, 00:04:00 Sat, 18 Apr 2015, 00:04:00 Sat, 02 May 2015, 00:05:00 Sat, 16 May 2015, 00:05:00 Sat, 30 May 2015, 00:05:00 Sat, 13 Jun 2015, 00:06:00 Sat, 27 Jun 2015, 00:06:00 Sat, 11 Jul 2015, 00:07:00 Sat, 25 Jul 2015, 00:07:00 Sat, 08 Aug 2015, 00:08:00 Sat, 22 Aug 2015, 00:08:00 Sat, 05 Sep 2015, 00:09:00 Sat, 19 Sep 2015, 00:09:00 Sat, 03 Oct 2015, 00:10:00 Sat, 17 Oct 2015, 00:10:00 Sat, 31 Oct 2015, 00:10:00

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:
40.49 ms | 403 KiB | 8 Q