/** * Sets a value in the current proxy object without triggering lazy loading through `__set` * * @link https://bugs.php.net/bug.php?id=63463 * * @param string $property * @param mixed $value */ public function setProxyValue($property, $value) { $reflectionProperty = new \ReflectionProperty($this->lazyObject, $property); $initializer = $this->lazyObject->__getInitializer(); // disabling initializer since setting `publicPersistentField` triggers `__set`/`__get` $this->lazyObject->__setInitializer(null); $reflectionProperty->setValue($this->lazyObject, $value); $this->lazyObject->__setInitializer($initializer); }