3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 1 => [ 'A' => ['AA' => 3, 'AB' => 5], 'B' => ['BA' => 2] ], 2 => [ 'C' => ['CA' => 4], 'D' => ['DA' => 1, 'DB' => 2] ], 3 => [ 'E' => ['EA' => 1, 'EB' => 2, 'EC' => 3], 'F' => ['FA' => 0, 'FB' => 7, 'FC' => 7] ] ]; $array |> (fn($sets) => array_map( fn($set) => $set |> array_values(...) |> (fn($vals) => array_merge(...$vals)) |> array_sum(...) , $sets )) |> var_export(...);
Output for git.master_jit, git.master
array ( 1 => 10, 2 => 7, 3 => 20, )

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:
45.58 ms | 788 KiB | 3 Q