Hi

I try to write a a weak reference extension for php5.3 to break circular object structures, so far I have a test implementation that seems to work fine with my first tests.

My current system uses a new base class that returns a new resource via a getWeakRef method.

This resource can be converted back to a new zval pointing to the object, or returning false if the object already is destroyed. So far so good, basic tests seems to work correct, the zend engine doesn't get screwed.

But general I would want to avoid using a base class all together, is there any way to get notified when a object gets out of scope (preferred without changing Zend internals)? I couldn't find a good answer by reading the code, changing the handler tables on the fly doesn't feel like the right solution. I am curious what is the purpose of the zend_objects_proxy apis?

Converting resources directly to an object by type cast would be nice and would avoid using a function for this, could this made somehow possible?

regards
Oskar

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to