3v4l.org

run code in 300+ PHP versions simultaneously
<?php $partylist = ['party1','party2','party3']; $position = ['position1','position2','position3']; $members= ['name1','name2','name3','name4','name5','name6','name7','name8','name9']; $partymembers = array_chunk($members,count($position)); $partyArray=[]; foreach($partylist as $key1 => $party){ $partyArray[$party] = []; foreach($position as $key2 => $p){ $partyArray[$party][$p] = isset($partymembers[$key1][$key2]) ? $partymembers[$key1][$key2] : ''; } } echo "<pre>".print_r($partyArray,1)."</pre>";
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [party1] => Array ( [position1] => name1 [position2] => name2 [position3] => name3 ) [party2] => Array ( [position1] => name4 [position2] => name5 [position3] => name6 ) [party3] => Array ( [position1] => name7 [position2] => name8 [position3] => name9 ) ) </pre>

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:
134.57 ms | 406 KiB | 5 Q