yes, that's what I meant :) sorry if I was unclear... if any references to a given variable still exist then the variable is not destroied in memory. -----Original Message----- From: Leif K-Brooks [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 12:55 AM To: John Coggeshall Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Deleting Objects
Not exactly true. unset() destroys the reference to the value, not the value itself. For instance, error_reporting(E_ALL); $var1 = "foo"; $var2 = &$var1; print "$var1\n$var2\n\n"; unset($var1); print "$var1\n$var2"; will output: foo foo <br /> <b>Notice</b>: Undefined variable: var1 in <b>PHPDocument1</b> on line <b>7</b><br /> foo In other words, unsetting $var1 will NOT destroy $var2. John Coggeshall wrote: If you want to force a variable to be destroied, just unset() it. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.