3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2019-09-28' => [ 'A' => 4, 'B' => 85, 'C' => 200, ], '2019-09-29' => [ 'A' => 5, 'B' => 83, 'C' => 202, ] ]; $res = []; foreach ($array as $key => $item) { foreach ($item as $itemKey => $itemValue) { $res[$itemKey][$key] = $itemValue; } } print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [A] => Array ( [2019-09-28] => 4 [2019-09-29] => 5 ) [B] => Array ( [2019-09-28] => 85 [2019-09-29] => 83 ) [C] => Array ( [2019-09-28] => 200 [2019-09-29] => 202 ) )

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