3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = Array ( '01-1970' => 0.00, '03-2019' => 4350.00, '05-2019' => 150.00, '06-2019' => 50.00 ); $a2 = Array ( '03-2019' => 0.00, '04-2019' => 0.00, '06-2019' => 34.83 ); $r = []; $keys = array_keys($a1+$a2); foreach($keys as $v){ $r[$v] = (empty($a1[$v]) ? 0 : $a1[$v]) + (empty($a2[$v]) ? 0 : $a2[$v]); } print_r($r);
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:
27.68 ms | 405 KiB | 5 Q