3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2012-07-01'); $interval = new DateInterval('P7D'); $end = new DateTime('2012-07-31'); $recurrences = 4; $iso = 'R4/2012-07-01T00:00:00Z/P7D'; // All of these periods are equivalent. $p = new DatePeriod($start, $interval, $recurrences); //$p = new DatePeriod($start, $interval, $end); //$p = new DatePeriod($iso); foreach ($p as $d) { echo $d->format('d '); } echo "\n"; $p = \PHP_VERSION_ID >= 70107 ? clone $p : new \DatePeriod( $p->getStartDate(), new \DateInterval($p->getDateInterval()->format('P%yY%mM%dDT%hH%iM%sS')), $p->getEndDate() ?: $p->recurrences, (int) $p->include_start_date ) ; foreach ($p as $d) { echo $d->format('d '); }
Output for git.master, git.master_jit, rfc.property-hooks
01 08 15 22 29 01 08 15 22 29

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:
61.15 ms | 401 KiB | 8 Q