3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getMonthLibelleByDates($filtre) { $format1 = []; $format2 = []; $date = new DateTime(); for ($i = 1; $i <= 12; $i++) { $format1[] = $date->format("M-Y"); $format2[] = $date->format("Y-m-d"); $date->modify("-1 month"); } return array( 'format1'=> $format1, 'format2' => $format2 ); } var_dump(getMonthLibelleByDates(""));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["format1"]=> array(12) { [0]=> string(8) "Jun-2019" [1]=> string(8) "May-2019" [2]=> string(8) "Apr-2019" [3]=> string(8) "Mar-2019" [4]=> string(8) "Feb-2019" [5]=> string(8) "Jan-2019" [6]=> string(8) "Dec-2018" [7]=> string(8) "Nov-2018" [8]=> string(8) "Oct-2018" [9]=> string(8) "Sep-2018" [10]=> string(8) "Aug-2018" [11]=> string(8) "Jul-2018" } ["format2"]=> array(12) { [0]=> string(10) "2019-06-26" [1]=> string(10) "2019-05-26" [2]=> string(10) "2019-04-26" [3]=> string(10) "2019-03-26" [4]=> string(10) "2019-02-26" [5]=> string(10) "2019-01-26" [6]=> string(10) "2018-12-26" [7]=> string(10) "2018-11-26" [8]=> string(10) "2018-10-26" [9]=> string(10) "2018-09-26" [10]=> string(10) "2018-08-26" [11]=> string(10) "2018-07-26" } }

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:
58.86 ms | 1712 KiB | 4 Q