protected static function isAssoc(array $array)
    {
        if (empty($array)) {
            return false;
        }

        if (isset($array[0])) {
            $n = count($array) - 1;

            return array_sum(array_keys($array)) != ($n * ($n + 1)) / 2;
        } else {
            return true;
        }
    }