3v4l.org

run code in 300+ PHP versions simultaneously
<?php $collections = [ 0 => [ 0 => [ "attr_id" => 23, "value" => "Single Side" ], 1 => [ "attr_id" => 23, "value" => "Double Side" ], ], 1 => [ 0 => [ "attr_id" => 31, "value" => "A4" ], 1 => [ "attr_id" => 31, "value" => "12x18" ], 2 => [ "attr_id" => 31, "value" => "B5" ], 3 => [ "attr_id" => 31, "value" => "A5" ] ] ]; $expected = []; foreach($collections as $k=>$v){ foreach($v as $k1=>$v1){ $expected[$v1['attr_id']][] = $v1['value']; } } print_r($expected) ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [23] => Array ( [0] => Single Side [1] => Double Side ) [31] => Array ( [0] => A4 [1] => 12x18 [2] => B5 [3] => A5 ) )

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:
52.52 ms | 1689 KiB | 4 Q