note 83121 added to language.references.arent
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 11 May 2008 16:52:15 +0000 |
| Subject: | note 83121 added to language.references.arent | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139282@lists.php.net to get a copy of this message | ||
<?php
function foo(&$var)
{
$var =& $GLOBALS["baz"];
}
foo($bar);
?>
As the example bellow, which just say out the reference is equal to the pointer of variables as c.
See the $var as the pointer, firstly it point to the $bar, then as we use "=&" assign
it, it change the pointer itself(not content) and point to the $GLOBALS["baz"].In this
flow, the $bar change neighter its ponter nor the content.
This is just the concept in C, isn't it?
----
Server IP: 69.147.83.197
Probable Submitter: 221.222.78.239
----
Manual Page -- http://www.php.net/manual/en/language.references.arent.php
Edit -- https://master.php.net/note/edit/83121
Del: integrated -- https://master.php.net/note/delete/83121/integrated
Del: useless -- https://master.php.net/note/delete/83121/useless
Del: bad code -- https://master.php.net/note/delete/83121/bad+code
Del: spam -- https://master.php.net/note/delete/83121/spam
Del: non-english -- https://master.php.net/note/delete/83121/non-english
Del: in docs -- https://master.php.net/note/delete/83121/in+docs
Del: other reasons-- https://master.php.net/note/delete/83121
Reject -- https://master.php.net/note/reject/83121
Search -- https://master.php.net/manage/user-notes.php