public function __set($offset, $value) { if ($offset === null) { $offset = count($this->data); } if (is_array($value)) { $safety = new Volatile(); $safety->merge($this->convertToVolatile($value)); $value = $safety; } return $this->data[$offset] = $value; }
public function __set($offset, $value) { if ($offset === null) { $offset = count($this->data); } if (!$this instanceof Volatile) { if (isset($this->data[$offset]) && $this->data[$offset] instanceof Threaded) { throw new \RuntimeException(); } } if (is_array($value)) { $safety = new Volatile(); $safety->merge($this->convertToVolatile($value)); $value = $safety; } return $this->data[$offset] = $value; }