- array_count_values: documentation ( source)
<?php
$iWannaUseThePikey = array( // Look ma, it's an array
'foo' => '1',
'bar' => '2',
'baz' => '3',
'zip' => '1');
// This throws type warnings all over the place - no Timmy, it's not an array
$boris = array_count_values($iWannaUseThePikey);
// This doesn't. Let's cast the array to an array just to make sure... oh ok now it's an array
$avi = array_count_values((array)$iWannaUseThePikey);