3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(45, 5, 1, 22, 22, 10, 10); //use array_count_values to counts all the values of an array. $get_repeated_value = array_count_values($array); $final_array = array(); foreach($get_repeated_value as $key => $value){ //If value is repeated, get the index of that values from array. if($value > 1){ $final_array[$key] = array_keys($array, $key); } } echo "<pre>"; print_r($final_array); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [22] => Array ( [0] => 3 [1] => 4 ) [10] => Array ( [0] => 5 [1] => 6 ) )

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