note 28767 added to language.references
| From: | marc at rack1 dot php dot net | Date: | Thu, 23 Jan 2003 11:13:24 +0000 |
| Subject: | note 28767 added to language.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42640@lists.php.net to get a copy of this message | ||
If you want to reset a variable which is a reference, you can do that with the unset() function.
$a = "foo";
$b = &$a;
$b references to $a now:
echo $b // => "foo"
$b = NULL; // => now $a is NULL, too
but:
unset($b);
$b = NULL; // => $a is still "foo" and $b is NULL
--
http://www.php.net/manual/en/language.references.php
http://master.php.net/manage/user-notes.php?action=edit+28767
http://master.php.net/manage/user-notes.php?action=delete+28767
http://master.php.net/manage/user-notes.php?action=reject+28767