note 87863 deleted from functions.arguments by danbrown
| From: | danbrown@php.net | Date: | Sat, 27 Dec 2008 20:08:24 +0000 |
| Subject: | note 87863 deleted from functions.arguments by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148587@lists.php.net to get a copy of this message | ||
Note Submitter: exceptione at hotmail dot com
----
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.