|
ВведениеWeak references provide a non-intrusive gateway to ephemeral objects. Unlike normal (strong) references, weak references do not prevent the garbage collector from freeing that object. For this reason, an object may be destroyed even though a weak reference to that object still exists. In such conditions, the weak reference seamlessly becomes invalid.
Пример #1 Weakref usage example
<?php Результат выполнения данного примера: Object still exists! object(MyClass)#1 (0) { } Destroying object! Object is dead! |
|