3v4l.org

run code in 300+ PHP versions simultaneously
<?php $masterArray = [ [ 'GB' => 20827, 'US' => 73, 'ES' => 23 ], [ 'GB' => 15070, 'US' => 3920 ] ]; $final = []; foreach($masterArray as $subArray) { foreach($subArray AS $key => $value) { $final[$key] = isset($final[$key]) ? $final[$key] + $value : $value; } } print_r($final);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [GB] => 35897 [US] => 3993 [ES] => 23 )

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