note 125374 added to language.references.pass
| From: | yiangforwork at gmail dot com | Date: | Thu, 17 Sep 2020 01:35:14 +0000 |
| Subject: | note 125374 added to language.references.pass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215131@lists.php.net to get a copy of this message | ||
function set(&$arr) {
$test = 10;
$arr = &$test;
}
$arr = [1, 2, 3];
set( $arr );
var_dump( $arr ); // [1, 2, 3]
If you changed a reference variable with a new
Address, the variable it originally
pointed to won't change.
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.167.36 (proxied: 8.210.37.121)
----
Manual Page -- http://php.net/manual/en/language.references.pass.php
Edit -- https://master.php.net/note/edit/125374
Del: integrated -- https://master.php.net/note/delete/125374/integrated
Del: useless -- https://master.php.net/note/delete/125374/useless
Del: bad code -- https://master.php.net/note/delete/125374/bad+code
Del: spam -- https://master.php.net/note/delete/125374/spam
Del: non-english -- https://master.php.net/note/delete/125374/non-english
Del: in docs -- https://master.php.net/note/delete/125374/in+docs
Del: other reasons-- https://master.php.net/note/delete/125374
Reject -- https://master.php.net/note/reject/125374
Search -- https://master.php.net/manage/user-notes.php