note 83521 added to language.references.whatdo
| From: | Drewseph at osu1 dot php dot net | Date: | Thu, 29 May 2008 23:15:06 +0000 |
| Subject: | note 83521 added to language.references.whatdo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139988@lists.php.net to get a copy of this message | ||
If you set a variable before passing it to a function that takes a variable as a reference, it is
much harder (if not impossible) to edit the variable within the function.
Example:
<?php
function foo(&$bar) {
$bar = "hello\n";
}
foo($unset);
echo($unset);
foo($set = "set\n");
echo($set);
?>
Output:
hello
set
It baffles me, but there you have it.
----
Server IP: 64.71.164.2
Probable Submitter: 128.8.215.134
----
Manual Page -- http://www.php.net/manual/en/language.references.whatdo.php
Edit -- https://master.php.net/note/edit/83521
Del: integrated -- https://master.php.net/note/delete/83521/integrated
Del: useless -- https://master.php.net/note/delete/83521/useless
Del: bad code -- https://master.php.net/note/delete/83521/bad+code
Del: spam -- https://master.php.net/note/delete/83521/spam
Del: non-english -- https://master.php.net/note/delete/83521/non-english
Del: in docs -- https://master.php.net/note/delete/83521/in+docs
Del: other reasons-- https://master.php.net/note/delete/83521
Reject -- https://master.php.net/note/reject/83521
Search -- https://master.php.net/manage/user-notes.php