public function offsetSet($key, $value)
    {
        if ($key === null) {
            $intKeys = array_filter($this->keys, 'is_int');
            $this->keys[] = $i = empty($intKeys) ? 0 : max(max($intKeys) + 1, 0);
            $this->values[] = $value;
            $this->keysIndices[$i] = count($this->values) - 1;
        } elseif (($index = $this->keysIndices[self::keyString($key)] ?? null) === null) {
            $this->keys[] = $key;
            $this->values[] = $value;
            $this->keysIndices[self::keyString($key)] = count($this->values) - 1;
        } else {
            $this->values[$index] = $value;
        }
    }