doctrine/orm · error · InvalidArgumentException

Undefined property: {offset}

Error message

Undefined property: {offset}

What it means

Error "Undefined property: {offset}" thrown in doctrine/orm.

Source

Thrown at src/Mapping/ArrayAccessImplementation.php:39

            'Using ArrayAccess on %s is deprecated and will not be possible in Doctrine ORM 4.0. Use the corresponding property instead.',
            static::class,
        );

        return isset($this->$offset);
    }

    /** @param string $offset */
    public function offsetGet(mixed $offset): mixed
    {
        Deprecation::trigger(
            'doctrine/orm',
            'https://github.com/doctrine/orm/pull/11211',
            'Using ArrayAccess on %s is deprecated and will not be possible in Doctrine ORM 4.0. Use the corresponding property instead.',
            static::class,
        );

        if (! property_exists($this, $offset)) {
            throw new InvalidArgumentException('Undefined property: ' . $offset);
        }

        return $this->$offset;
    }

    /** @param string $offset */
    public function offsetSet(mixed $offset, mixed $value): void
    {
        Deprecation::trigger(
            'doctrine/orm',
            'https://github.com/doctrine/orm/pull/11211',
            'Using ArrayAccess on %s is deprecated and will not be possible in Doctrine ORM 4.0. Use the corresponding property instead.',
            static::class,
        );

        $this->$offset = $value;
    }

View on GitHub (pinned to d9b9ff7301)

When it happens

Trigger: Thrown at src/Mapping/ArrayAccessImplementation.php:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of doctrine/orm@d9b9ff7301 (2026-08-21). Data as JSON: /api/errors/4f6e8f23525a840a. Report an issue: GitHub.