3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cha12 = array(); $cha1_count = 3; $cha2_count = 3; $cha12[0][0] = 3; $cha12[0][1] = 6; $cha12[0][2] = 2; $cha12[1][0] = 4; $cha12[1][1] = 5; $cha12[1][2] = 3; $cha12[2][0] = 2; $cha12[2][1] = 2; $cha12[2][2] = 8; $fcount = 0; $fcount_array = array(); $fc = 0; for($count1=0;$count1<$cha1_count;$count1++){ for($count2=0;$count2<$cha2_count;$count2++){ $fc = ($cha2_count * $count1) + $count2; $fcount_array[$fc] = $cha12[$count1][$count2]; } } asort($fcount_array); print_r($fcount_array); $acv = array_count_values($fcount_array); sort($acv); print_r($acv); ?>
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
Array ( [6] => 2 [2] => 2 [7] => 2 [0] => 3 [5] => 3 [3] => 4 [4] => 5 [1] => 6 [8] => 8 ) Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 [4] => 2 [5] => 3 )
Output for hhvm-3.10.0 - 3.12.0
Array ( [2] => 2 [6] => 2 [7] => 2 [0] => 3 [5] => 3 [3] => 4 [4] => 5 [1] => 6 [8] => 8 ) Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 [4] => 2 [5] => 3 )