public function offsetSet($offset, $value) { if (is_array($this->object)) { $this->object[$offset] = $value; return; } $this->object->{$offset} = $value; }