3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = (new DateTime('1 year ago'))->modify('first 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 ( [2021-03-01] => 2021-03 [2021-02-01] => 2021-02 [2021-01-01] => 2021-01 [2020-12-01] => 2020-12 [2020-11-01] => 2020-11 [2020-10-01] => 2020-10 [2020-09-01] => 2020-09 [2020-08-01] => 2020-08 [2020-07-01] => 2020-07 [2020-06-01] => 2020-06 [2020-05-01] => 2020-05 [2020-04-01] => 2020-04 )

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