From: absynthe dot is at free dot fr Operating system: linux PHP version: 5.2.5 PHP Bug Type: Feature/Change Request Bug description: unable to unset reference
Description: ------------ Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --------------- <? $x = new stdClass(); $x->a = 'ayayaye'; $b[0] =& $x; unset($b[0]); var_dump($x); ?> Expected result: ---------------- NULL Actual result: -------------- object(stdClass)#1 (1) { ["a"]=> string(7) "ayayaye" } -- Edit bug report at http://bugs.php.net/?id=44175&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44175&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44175&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44175&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44175&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44175&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44175&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44175&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44175&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44175&r=support Expected behavior: http://bugs.php.net/fix.php?id=44175&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44175&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44175&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44175&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44175&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44175&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44175&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44175&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44175&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44175&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44175&r=mysqlcfg