3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ ["ID" => 2, "vendor_id" => "37", "order_id" => 776], ], [ ["ID" => 2, "vendor_id" => "37", "order_id" => 786], ] ]; $result = []; foreach ($array as $group) { foreach ($group as $row) { $result[$row['order_id']][] = $row; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 776 => array ( 0 => array ( 'ID' => 2, 'vendor_id' => '37', 'order_id' => 776, ), ), 786 => array ( 0 => array ( 'ID' => 2, 'vendor_id' => '37', 'order_id' => 786, ), ), )

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