From: mike dot hall at twistdigital dot co dot uk Operating system: FreeBSD PHP version: 5.1.0b2 PHP Bug Type: Class/Object related Bug description: unset() doesn't destroy object with internal references
Description: ------------ PHP doesn't unset an object if it contains variables that include references to itself. Despite being unset, the objects remain in memory until the end of the request. This can lead to scripts consuming large amounts of memory when larger and more complex objects are being employed. Reproduce code: --------------- http://www.indelible.org.uk/reproduce.php Expected result: ---------------- 0 Create A Create B Destroying B Destroying A 1 Create A Create B Destroying B Destroying A 2 Create A Create B Destroying B Destroying A End of Loop Actual result: -------------- 0 Create A Create B 1 Create A Create B 2 Create A Create B End of Loop Destroying A Destroying B Destroying A Destroying B Destroying A Destroying B -- Edit bug report at http://bugs.php.net/?id=33711&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33711&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33711&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33711&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33711&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33711&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33711&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33711&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33711&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33711&r=support Expected behavior: http://bugs.php.net/fix.php?id=33711&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33711&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33711&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33711&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33711&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33711&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33711&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33711&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33711&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33711&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33711&r=mysqlcfg