note 87863 added to functions.arguments
| From: | exceptione at hotmail dot com | Date: | Sat, 27 Dec 2008 19:43:35 +0000 |
| Subject: | note 87863 added to functions.arguments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148586@lists.php.net to get a copy of this message | ||
Something that the documentation doesn't make clear is that you don't need to initialize a
variable before passing it to a function that will treat it as an reference. Example
<?php
function foo(&$arg) {
$arg = "whaha";
}
foo($anUndefinedVar); // using an undefined var is perfectly valid,
echo $anUndefinedVar; // you don't get an undefined variable error
// output: whaha
?>
You see? I didn't declare that $anUndefinedVar anywhere.
----
Server IP: 83.137.20.135
Probable Submitter: 83.247.70.113
----
Manual Page -- http://www.php.net/manual/en/functions.arguments.php
Edit -- https://master.php.net/note/edit/87863
Del: integrated -- https://master.php.net/note/delete/87863/integrated
Del: useless -- https://master.php.net/note/delete/87863/useless
Del: bad code -- https://master.php.net/note/delete/87863/bad+code
Del: spam -- https://master.php.net/note/delete/87863/spam
Del: non-english -- https://master.php.net/note/delete/87863/non-english
Del: in docs -- https://master.php.net/note/delete/87863/in+docs
Del: other reasons-- https://master.php.net/note/delete/87863
Reject -- https://master.php.net/note/reject/87863
Search -- https://master.php.net/manage/user-notes.php