php-weakref
php-weakref copied to clipboard
PECL extension that implements weak references and weak maps in PHP
https://github.com/php/php-src/blob/php-7.3.0RC1/UPGRADING.INTERNALS#L90-L96
Just added fixes to support PHP 7.3, and also removed some dead code As of now - have not tested on lower versions of PHP
I've been finding segfaults in production. I'm not using weakref directly but it is part of the dependencies for a library that I'm using (https://github.com/OggettoWeb/messenger/wiki/Installation-&-Setup#weakref), so I haven't got steps...
old_dtors it actually holds zend_object_dtor_obj_t's, not zval's, so Z_PTR_P() didn't do any good
imagine the following: ``` php $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...