3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( "0" => "red", "1" => "green" , "2" => "red" , "3" => "blue", "4" => "blue", "5" => "blue" ); $group_by_data = array_count_values($a); $keys = []; foreach($a as $key => $color){ if($group_by_data[$color] > 1){ if(!isset($keys[$color])) $keys[$color] = []; $keys[$color][] = $key; } } print_r($keys);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [red] => Array ( [0] => 0 [1] => 2 ) [blue] => Array ( [0] => 3 [1] => 4 [2] => 5 ) )

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:
135.39 ms | 405 KiB | 5 Q