note 72945 added to language.references.unset
| From: | sony-santos at bol dot com dot br | Date: | Mon, 05 Feb 2007 11:56:14 +0000 |
| Subject: | note 72945 added to language.references.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122879@lists.php.net to get a copy of this message | ||
<?php
//if you do:
$a = "hihaha";
$b = &$a;
$c = "eita";
$b = $c;
echo $a; // shows "eita"
$a = "hihaha";
$b = &$a;
$c = "eita";
$b = &$c;
echo $a; // shows "hihaha"
$a = "hihaha";
$b = &$a;
$b = null;
echo $a; // shows nothing (both are set to null)
$a = "hihaha";
$b = &$a;
unset($b);
echo $a; // shows "hihaha"
$a = "hihaha";
$b = &$a;
$c = "eita";
$a = $c;
echo $b; // shows "eita"
$a = "hihaha";
$b = &$a;
$c = "eita";
$a = &$c;
echo $b; // shows "hihaha"
$a = "hihaha";
$b = &$a;
$a = null;
echo $b; // shows nothing (both are set to null)
$a = "hihaha";
$b = &$a;
unset($a);
echo $b; // shows "hihaha"
?>
I tested each case individually on PHP 4.3.10.
----
Server IP: 69.147.83.197
Probable Submitter: 201.26.211.13 (proxied: 192.168.0.6)
----
Manual Page -- http://www.php.net/manual/en/language.references.unset.php
Edit -- https://master.php.net/note/edit/72945
Del: integrated -- https://master.php.net/note/delete/72945/integrated
Del: useless -- https://master.php.net/note/delete/72945/useless
Del: bad code -- https://master.php.net/note/delete/72945/bad+code
Del: spam -- https://master.php.net/note/delete/72945/spam
Del: non-english -- https://master.php.net/note/delete/72945/non-english
Del: in docs -- https://master.php.net/note/delete/72945/in+docs
Del: other reasons-- https://master.php.net/note/delete/72945
Reject -- https://master.php.net/note/reject/72945
Search -- https://master.php.net/manage/user-notes.php