3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userdb=Array ( 0 => Array ( "uid"=> '100', "name" => 'Sandra Shush', "url"=> 'urlof100' ), 1 => Array ( "uid"=> '5465', "name" => 'Sandra Shush', "url"=> 'urlof100' ), 2 => Array ( "uid"=> '100', "name" => 'Sandra Shush', "url"=> 'urlof100' ), 3 => Array ( "uid"=> '5465', "name" => 'Sandra Shush', "url"=> 'urlof100' ), ); // Get all uids to an flat array $uid = array_column($userdb, "uid"); // Loop the unique uids and find all matching uids and place them in array Foreach(array_unique($uid) as $id){ $new[] = array_intersect_key($userdb, array_intersect($uid, [$id])); } Var_dump($new);
Output for rfc.property-hooks, git.master_jit, git.master
array(2) { [0]=> array(2) { [0]=> array(3) { ["uid"]=> string(3) "100" ["name"]=> string(12) "Sandra Shush" ["url"]=> string(8) "urlof100" } [2]=> array(3) { ["uid"]=> string(3) "100" ["name"]=> string(12) "Sandra Shush" ["url"]=> string(8) "urlof100" } } [1]=> array(2) { [1]=> array(3) { ["uid"]=> string(4) "5465" ["name"]=> string(12) "Sandra Shush" ["url"]=> string(8) "urlof100" } [3]=> array(3) { ["uid"]=> string(4) "5465" ["name"]=> string(12) "Sandra Shush" ["url"]=> string(8) "urlof100" } } }

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:
42.39 ms | 1620 KiB | 4 Q