src/AbstractJsonEncoder.php
private function isAssociative(array $array)
    {
        if ($array === []) {
            return false;
        }

        $expected = 0;

        foreach ($array as $key => $_) {
            if ($key !== $expected++) {
                return true;
            }
        }

        return false;
    }
private function isAssociative(array $array)
    {
        if ($array === []) {
            return false;
        }

        $expected = 0;

        foreach ($array as $key => $_) {
            if ($key !== $expected++) {
                return true;
            }
        }

        return false;
    }
private function isAssociative ( array $ array ) { if ( $ array === [ ] ) { return false ; } $ expected = 0 ; foreach ( $ array as $ key => $ _ ) { if ( $ key !== $ expected ++ ) { return true ; } } return false ; }
Tells if the given array is an associative array.
@param array $array The array to test
@return bool True if the array is associative, false if not
Tells if the given array is an associative array .