note 117306 added to function.unset
| From: | mike at eastghost dot com | Date: | Tue, 19 May 2015 19:09:11 +0000 |
| Subject: | note 117306 added to function.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202609@lists.php.net to get a copy of this message | ||
beware unset() destroys references
(this is already noted but not as plainly)
$x = 'x';
change( $x );
echo $x; // outputs "x" not "q23" ---- remove the unset() and output is
"q23" not "x"
function change( & $x )
{
unset( $x );
$x = 'q23';
return true;
}
----
Server IP: 72.52.91.14
Probable Submitter: 74.96.181.211
----
Manual Page -- http://php.net/manual/en/function.unset.php
Edit -- https://master.php.net/note/edit/117306
Del: integrated -- https://master.php.net/note/delete/117306/integrated
Del: useless -- https://master.php.net/note/delete/117306/useless
Del: bad code -- https://master.php.net/note/delete/117306/bad+code
Del: spam -- https://master.php.net/note/delete/117306/spam
Del: non-english -- https://master.php.net/note/delete/117306/non-english
Del: in docs -- https://master.php.net/note/delete/117306/in+docs
Del: other reasons-- https://master.php.net/note/delete/117306
Reject -- https://master.php.net/note/reject/117306
Search -- https://master.php.net/manage/user-notes.php