Open
Description
imagine the following:
$x = new WeakRef($obj);
$x->onLoss(function() use($map){
echo "the object was garbage collected";
$map->remove($weakref);
});
// or even...
$x->onBeforeLoss(function($object){
echo "the object is about to be garbage collected";
$map->save($object->serialize());
// $weakref->acquire(); -> triggers "you aren't allowed to acquire a strong reference here"
});