Re: [PHP-DEV] circular crash testcase From: Andi Gutmans (andi <email protected>)
Date: 08/15/00

At 02:52 AM 8/15/00 +0200, waldschrott wrote:
>>I just commited a patch which hopefully closes all of these bugs.
>>Note that your example leaks now like it should in a reference counting
>>environment. It is of course cleaned up at the end of the request.
>>I hope I didn't break anything with this patch. Such patches tend to
>>propogate to weird places to please test it.
>
>yep, it works, just tested
>
>thus is stas´ beloved sentence ('PHP doesn´t support circular references')
>outdated or how do I have to understand it.
>forgive my incompetence, but what does it mean for me that "it leaks now
>like it should in a ref-count env", does zend create a temporary copy of
>that object on access or... ?

Stas is right in certain contexts but it really depends what you are doing.
In any way, what happens with circular references is that you end up having
a circle point at itself, when the Zend Engine frees this, one of the
memory blocks still has a reference count although nothing is really
pointing at it anymore.
This is how languages which have reference counting work. Perl uses the
same kind of reference counting and I assume they have something similar.
Not to have such a situation involves in writing a full fledged garbage
collector like in Java. I don't think we want to see a garbage collector in
PHP. It kind of sucks.

Andi

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>