WeakReference
final class WeakReference (View source)
Weak references allow the programmer to retain a reference to an object which does not prevent the object from being destroyed.
They are useful for implementing cache like structures.
Methods
This method exists only to disallow instantiation of the WeakReference class. Weak references are to be instantiated with the factory method WeakReference::create().
Create a new weak reference.
Gets a weakly referenced object. If the object has already been destroyed, NULL is returned.
Details
__construct()
This method exists only to disallow instantiation of the WeakReference class. Weak references are to be instantiated with the factory method WeakReference::create().
static WeakReference
create(object $object)
Create a new weak reference.
object|null
get()
Gets a weakly referenced object. If the object has already been destroyed, NULL is returned.