php8.5
Home/ Manual/ reflection / reflectionclass/ ReflectionClass::resetAsLazyProxy

ReflectionClass::resetAsLazyProxy

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Resets an object and marks it as lazy

Description

ReflectionClass::resetAsLazyProxy(object $object, callable $factory, int $options = 0): void

The behavior of this method is the same as ReflectionClass::resetAsLazyGhost except that it uses the proxy strategy.

The object itself becomes the proxy. Similarly to ReflectionClass::resetAsLazyGhost, the object is not replaced by an other one, and its identity does not change, even after initialization. The proxy and the real instance are distinct objects, with distinct identities.

Parameters

object

A non-lazy object, or an initialized lazy object.

factory

An factory callback with the same signature and purpose as in ReflectionClass::newLazyProxy.

Return Values

Void

See Also

  • ReflectionClass::newLazyProxy
  • ReflectionClass::resetAsLazyGhost

Source: reference/reflection/reflectionclass/resetaslazyproxy.xml · from the official PHP manual (php/doc-en)