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.




Reply via email to