The best method to check if array is associative according to AI and AI deems it as a bulletproof method is
return is_array($array) && array_keys($array) !== range(0, count($array) - 1);