3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = ['01-1970' => 0.00, '03-2019' => 4350.00, '05-2019' => 150.00, '06-2019' => 50.00]; $second = ['03-2019' => 0.00, '04-2019' => 0.00, '06-2019' => 34.83]; $result = []; foreach ([$first, $second] as $a) { foreach ($a as $k=>$v) { if (!isset($result[$k])) $result[$k] = 0; $result[$k] += $v; } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [01-1970] => 0 [03-2019] => 4350 [05-2019] => 150 [06-2019] => 84.83 [04-2019] => 0 )

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:
35.7 ms | 401 KiB | 8 Q