3v4l.org

run code in 300+ PHP versions simultaneously
<?php $begin_date = new DateTime('2016-01-01 00:00:00'); $end_date = new DateTime('2017-05-02 23:59:59'); $result = array(); $current = clone $begin_date; while ($current < $end_date) { array_push($result, $current->format('Y-m')); $current->add(DateInterval::createFromDateString('1 Month')); } var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(17) { [0]=> string(7) "2016-01" [1]=> string(7) "2016-02" [2]=> string(7) "2016-03" [3]=> string(7) "2016-04" [4]=> string(7) "2016-05" [5]=> string(7) "2016-06" [6]=> string(7) "2016-07" [7]=> string(7) "2016-08" [8]=> string(7) "2016-09" [9]=> string(7) "2016-10" [10]=> string(7) "2016-11" [11]=> string(7) "2016-12" [12]=> string(7) "2017-01" [13]=> string(7) "2017-02" [14]=> string(7) "2017-03" [15]=> string(7) "2017-04" [16]=> string(7) "2017-05" }

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