3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [[0,"A" => 176000], [0, "b" => 500], [0, 3960000, 200], [10, 500, 200]]; foreach($arrays as $sub){ foreach($sub as $key => $num){ if(!isset($new[$key])) $new[$key] =0; $new[$key] += $num; } } var_dump($new);
Output for git.master_jit, git.master, rfc.property-hooks
array(5) { [0]=> int(10) ["A"]=> int(176000) ["b"]=> int(500) [1]=> int(3960500) [2]=> int(400) }

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:
190.57 ms | 405 KiB | 5 Q