3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(getPeroid()->start); function getPeroid(\Datetime $date = null, DateInterval $interval = null) { $interval = $interval ? : new DateInterval('P7D'); $end = $date ? : new DateTime(); $end->modify("Last Sunday"); $start = clone $end; $start->sub($interval); return (object) array( "start" => $start->format("l, d F Y"), "end" => $end->format("l, d F Y") ); } function getPeriodBetween(Datetime $start = null, Datetime $end = null, DateInterval $interval = null) { $interval = $interval ? : new DateInterval('P7D'); if ($start === null) { $start = new DateTime(); $start->modify("First Sunday of January"); } else { $start->modify("First Sunday"); } if ($end === null) { $end = new DateTime(); $end->modify("Last Sunday of December"); } $range = array(); while ( $start < $end ) { $r = (object) array( "start" => $start->format("l, d F Y") ); $start->add($interval); $r->end = $start->format("l, d F Y"); $range[] = $r; } return $range; }
Output for git.master, git.master_jit, rfc.property-hooks
Sunday, 31 March 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:
39.98 ms | 401 KiB | 8 Q