public function offsetSet($key, $data)
    {
        if (!$this->allow_modification) {
            throw new RuntimeException('Attempting to write to an immutable array');
        }

        if (isset($data) && is_array($data)) {
            $data = new static($data);
        }

        return parent::offsetSet($key, $data);
    }