src/AbstractJsonEncoder.php
private function isObject($iterable, \Iterator $iterator)
    {
        if ($this->options & JSON_FORCE_OBJECT) {
            return true;
        }

        if ($iterable instanceof \Traversable) {
            return $iterator->valid() && $iterator->key() !== 0;
        }

        return is_object($iterable) || $this->isAssociative($iterable);
    }
private function isObject($iterable, \Iterator $iterator)
    {
        if ($this->options & JSON_FORCE_OBJECT) {
            return true;
        }

        if ($iterable instanceof \Traversable) {
            return $iterator->valid() && $iterator->key() !== 0;
        }

        return is_object($iterable) || $this->isAssociative($iterable);
    }
private function isObject ( $ iterable , \ Iterator $ iterator ) { if ( $ this -> options & JSON_FORCE_OBJECT ) { return true ; } if ( $ iterable instanceof \ Traversable ) { return $ iterator -> valid ( ) && $ iterator -> key ( ) !== 0 ; } return is_object ( $ iterable ) || $ this -> isAssociative ( $ iterable ) ; }
Tells if the given iterable should be handled as a JSON object or not.
@param object|array $iterable The iterable value to test
@param \Iterator $iterator An Iterator created from the iterable value
@return bool True if the given iterable should be treated as object, false if not
Tells if the given iterable should be handled as a JSON object or not .