3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = [ [ 'type' => 25500, 'month' => 'July' ], [ 'type' => 5465, 'month' => 'January' ], [ 'type' => 40000, 'month' => 'April' ], [ 'type' => 35000, 'month' => 'June' ], [ 'type' => 10000, 'month' => 'February' ] ]; $allMonths = ['January','February','March', 'April','May','June','July','August','September','October','November','December']; $currentMonths = array_column($d, 'month'); $notIncludedMonth = array_diff($allMonths,$currentMonths); foreach ($notIncludedMonth as $month) { $d[] = [ 'type' => 0, 'month' => $month, ]; } print_r($d);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [type] => 25500 [month] => July ) [1] => Array ( [type] => 5465 [month] => January ) [2] => Array ( [type] => 40000 [month] => April ) [3] => Array ( [type] => 35000 [month] => June ) [4] => Array ( [type] => 10000 [month] => February ) [5] => Array ( [type] => 0 [month] => March ) [6] => Array ( [type] => 0 [month] => May ) [7] => Array ( [type] => 0 [month] => August ) [8] => Array ( [type] => 0 [month] => September ) [9] => Array ( [type] => 0 [month] => October ) [10] => Array ( [type] => 0 [month] => November ) [11] => Array ( [type] => 0 [month] => December ) )

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:
119.5 ms | 409 KiB | 5 Q