3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = (new DateTime('1 year ago'))->modify('last day of this month'); $end = (new DateTime())->modify('first day of this month'); $interval = new DateInterval('P1M'); $period = new DatePeriod($start, $interval, $end); $months = array(); foreach ($period as $dt) { $months[$dt->format('Y-m-d')] = $dt->format('Y-m'); } $reverse_months = array_reverse($months); print_r($reverse_months);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [2015-09-01] => 2015-09 [2015-08-01] => 2015-08 [2015-07-01] => 2015-07 [2015-06-01] => 2015-06 [2015-05-01] => 2015-05 [2015-04-01] => 2015-04 [2015-03-01] => 2015-03 [2015-02-01] => 2015-02 [2015-01-01] => 2015-01 [2014-12-01] => 2014-12 [2014-10-31] => 2014-10 )

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