src/Types/ArrayType.php
public function offsetSet($offset, $value)
    {
        if ($offset === null) {
            $this->value[] = $value;
            return;
        } elseif (!is_int($offset)) {
            throw new \InvalidArgumentException('An integer offset was expected');
        } elseif (!array_key_exists($offset, $this->value) && $offset !== count($this->value)) {
            throw new \InvalidArgumentException('Cannot set arbitrary offset in array');
        }
        $this->value[$offset] = $value;
    }
public function offsetSet($offset, $value)
    {
        if ($offset === null) {
            $this->value[] = $value;
            return;
        } elseif (!is_int($offset)) {
            throw new \InvalidArgumentException('An integer offset was expected');
        } elseif (!array_key_exists($offset, $this->value) && $offset !== count($this->value)) {
            throw new \InvalidArgumentException('Cannot set arbitrary offset in array');
        }
        $this->value[$offset] = $value;
    }
Change the item at some index in the collection.

\param int $offset
Index of the item to modify.

\param mixed $value
New value for the item at the given index.

\return
This method does not return any value.