3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array_1 = Array (4, 6, 2, 6, 4, 10, 4, 6, 2, 2, 4, 4, 2, 2 ); $array_2 = Array ("DK","GA","DK","GA","DK","GA","WE","VE","WE","VE","PLA","PRA","PLA","PRA" ) ; Foreach($array_2 as $key => $val){ If(!isset($new[$val])) $new[$val] =0; $new[$val] += $array_1[$key]; } Var_dump($new);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { ["DK"]=> int(10) ["GA"]=> int(22) ["WE"]=> int(6) ["VE"]=> int(8) ["PLA"]=> int(6) ["PRA"]=> int(6) }

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:
63.25 ms | 1425 KiB | 4 Q