3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(Array('b','d'), Array('c','a'), Array('b','d'), Array('a','d'), Array('c'), Array('c'), Array('a','d','e'), Array('d','b') ); function array_count_values_of($value, $array) { $counts = array_count_values($array); return $counts[$value]; } for($i=0 ; $i<count($array) ; $i++) { $temp = array_count_values_of($array[$i], $array); $result[$i][0] = $array[$i]; $result[$i][1] = $temp; } print_r($result);
Output for 4.3.2 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values(): Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Array ( [0] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [1] => Array ( [0] => Array ( [0] => c [1] => a ) [1] => ) [2] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [3] => Array ( [0] => Array ( [0] => a [1] => d ) [1] => ) [4] => Array ( [0] => Array ( [0] => c ) [1] => ) [5] => Array ( [0] => Array ( [0] => c ) [1] => ) [6] => Array ( [0] => Array ( [0] => a [1] => d [2] => e ) [1] => ) [7] => Array ( [0] => Array ( [0] => d [1] => b ) [1] => ) )
Output for hhvm-3.10.0 - 3.12.0
Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Invalid operand type was used: Invalid type used as key in /in/J1N8Z on line 14 Notice: Array to string conversion in /in/J1N8Z on line 14 Notice: Undefined index: Array in /in/J1N8Z on line 14 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Array ( [0] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [1] => Array ( [0] => Array ( [0] => c [1] => a ) [1] => ) [2] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [3] => Array ( [0] => Array ( [0] => a [1] => d ) [1] => ) [4] => Array ( [0] => Array ( [0] => c ) [1] => ) [5] => Array ( [0] => Array ( [0] => c ) [1] => ) [6] => Array ( [0] => Array ( [0] => a [1] => d [2] => e ) [1] => ) [7] => Array ( [0] => Array ( [0] => d [1] => b ) [1] => ) )
Output for 4.3.0 - 4.3.1
Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: array_count_values() [http://www.php.net/function.array-count-values]: Can only count STRING and INTEGER values! in /in/J1N8Z on line 13 Warning: Illegal offset type in /in/J1N8Z on line 14 Array ( [0] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [1] => Array ( [0] => Array ( [0] => c [1] => a ) [1] => ) [2] => Array ( [0] => Array ( [0] => b [1] => d ) [1] => ) [3] => Array ( [0] => Array ( [0] => a [1] => d ) [1] => ) [4] => Array ( [0] => Array ( [0] => c ) [1] => ) [5] => Array ( [0] => Array ( [0] => c ) [1] => ) [6] => Array ( [0] => Array ( [0] => a [1] => d [2] => e ) [1] => ) [7] => Array ( [0] => Array ( [0] => d [1] => b ) [1] => ) )