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);
    }