note 72162 added to language.references.unset
| From: | martin at osu1 dot php dot net | Date: | Fri, 05 Jan 2007 12:25:32 +0000 |
| Subject: | note 72162 added to language.references.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121312@lists.php.net to get a copy of this message | ||
note that in the previous example all variables (or the one data item all variables point to) is set
to NULL, what is interpreted as !isset(), but the linkage between the variables still exists, so
<?php
echo (isset($a)?"set":"unset")."\n";
$a=1;
$b =& $a;
echo (isset($b)?"set":"unset")."\n";
$a=null;
echo (isset($b)?"set":"unset")."\n";
$a=1;
echo (isset($b)?"set":"unset")."\n";
?>
shows:
unset
set
unset
set
note that $b ist set again.
So if you want to brake the linkage, you have to use unset()
----
Server IP: 217.160.72.57
Probable Submitter: 212.114.70.5
----
Manual Page -- http://www.php.net/manual/en/language.references.unset.php
Edit -- https://master.php.net/note/edit/72162
Del: integrated -- https://master.php.net/note/delete/72162/integrated
Del: useless -- https://master.php.net/note/delete/72162/useless
Del: bad code -- https://master.php.net/note/delete/72162/bad+code
Del: spam -- https://master.php.net/note/delete/72162/spam
Del: non-english -- https://master.php.net/note/delete/72162/non-english
Del: in docs -- https://master.php.net/note/delete/72162/in+docs
Del: other reasons-- https://master.php.net/note/delete/72162
Reject -- https://master.php.net/note/reject/72162
Search -- https://master.php.net/manage/user-notes.php