3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data =[ 0 =>[ 0 =>[ "my_first_key" => "option 1", "SUMME" => "6" ], 1 =>[ "my_first_key" => "option 2", "SUMME" => "22" ], 2 =>[ "my_first_key" => "option 3", "SUMME" => "37" ], 3 => [ "my_first_key" => "option 4", "SUMME" => "42" ] ], 1 =>[ 0 =>[ "my_second_key" => "option 1", "SUMME" => "8" ], 1 =>[ "my_second_key" => "option 2", "SUMME" => "24" ], 2 =>[ "my_second_key" => "option 3", "SUMME" => "39" ], 3 => [ "my_second_key" => "option 4", "SUMME" => "44" ] ] ]; $tmpArr = []; foreach($data as $dat){ foreach($dat as $d){ $key = array_keys($d)[0]; $tmpArr[$key][$d[$key]] = $d['SUMME']; } } print_r($tmpArr);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [my_first_key] => Array ( [option 1] => 6 [option 2] => 22 [option 3] => 37 [option 4] => 42 ) [my_second_key] => Array ( [option 1] => 8 [option 2] => 24 [option 3] => 39 [option 4] => 44 ) )

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:
28.91 ms | 406 KiB | 5 Q