3v4l.org

run code in 500+ PHP versions simultaneously
<?php $all_array = Array ( 0 => Array ( 'id' => 1, 'value' => 111 ), 1 => Array ( 'id' => 2, 'value' => 222 ), 2 => Array ( 'id' => 3, 'value' => 333 ), 3 => Array ( 'id' => 4, 'value' => 111 ) ); $finalArray = []; foreach($all_array as $arr){ $finalArray[$arr['value']] = $arr; } print_r($finalArray); print_r(array_values($finalArray));
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [111] => Array ( [id] => 4 [value] => 111 ) [222] => Array ( [id] => 2 [value] => 222 ) [333] => Array ( [id] => 3 [value] => 333 ) ) Array ( [0] => Array ( [id] => 4 [value] => 111 ) [1] => Array ( [id] => 2 [value] => 222 ) [2] => Array ( [id] => 3 [value] => 333 ) )

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:
27.04 ms | 1360 KiB | 4 Q