src/Bag.php
public function offsetSet($offset, $value)
    {
        //throw new BadMethodCallException(sprintf('Cannot modify items on an %s', __CLASS__));

        Deprecated::method(1.1, MutableBag::class);

        if ($offset === null) {
            $this->items[] = $value;
        } else {
            $this->items[$offset] = $value;
        }
    }
public function offsetSet($offset, $value)
    {
        //throw new BadMethodCallException(sprintf('Cannot modify items on an %s', __CLASS__));

        Deprecated::method(1.1, MutableBag::class);

        if ($offset === null) {
            $this->items[] = $value;
        } else {
            $this->items[$offset] = $value;
        }
    }
Don't call directly. Used for ArrayAccess.

@internal

@inheritdoc