def php_array_count_values(_array):
    """
    >>> php_array_count_values(Array(1, "hello", 1, "world", "hello"))
    {1: 2, 'hello': 2, 'world': 1}
    """
    cnt = {}
    for v in _array.values():
        if not v in cnt:
            cnt[v] = 1
        else:
            cnt[v] += 1
    return cnt