ID: 45225 Updated by: [EMAIL PROTECTED] Reported By: vituko at gmail dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Lenny PHP Version: 5.2.6 New Comment:
You've created a cyclic reference and they can't be destroyed until the script has ended. Previous Comments: ------------------------------------------------------------------------ [2008-06-10 05:04:46] vituko at gmail dot com Description: ------------ Garbage collection works in an unexpected way for me, when there're crossed references. I discovered it working with large databases, Apache crashes sometimes : the thread hangs and after /etc/init.d/apache2 restart, it continues working. Another thing : the only way to get track of references is debug_zval_dump (of course it can be done manually) and huge strings must be parsed. Further, when mixing true (&) and "php" references it's no more possible... or is it? Only a tought... Thanks Reproduce code: --------------- class a { public function __destruct() { echo 'destr<br>' ; } } $a = new a ; $a -> v = new a ; $a -> w = new a ; $a -> v -> w = $a -> w ; $a -> w -> v = $a -> v ; unset ($a) ; echo 'fin<br>' ; exit ; Expected result: ---------------- destr destr destr fin Actual result: -------------- destr fin destr destr ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45225&edit=1