note 71198 added to functions.arguments
| From: | John at osu1 dot php dot net | Date: | Wed, 15 Nov 2006 23:20:50 +0000 |
| Subject: | note 71198 added to functions.arguments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119764@lists.php.net to get a copy of this message | ||
This might be documented somewhere OR obvious to most, but when passing an argument by reference (as
of PHP 5.04) you can assign a value to an argument variable in the function call. For example:
function my_function($arg1, &$arg2) {
if ($arg1 == true) {
$arg2 = true;
}
}
my_function(true, $arg2 = false);
echo $arg2;
outputs 1 (true)
my_function(false, $arg2 = false);
echo $arg2;
outputs 0 (false)
----
Server IP: 66.163.161.117
Probable Submitter: 24.20.184.145
----
Manual Page -- http://www.php.net/manual/en/functions.arguments.php
Edit -- https://master.php.net/note/edit/71198
Del: integrated -- https://master.php.net/note/delete/71198/integrated
Del: useless -- https://master.php.net/note/delete/71198/useless
Del: bad code -- https://master.php.net/note/delete/71198/bad+code
Del: spam -- https://master.php.net/note/delete/71198/spam
Del: non-english -- https://master.php.net/note/delete/71198/non-english
Del: in docs -- https://master.php.net/note/delete/71198/in+docs
Del: other reasons-- https://master.php.net/note/delete/71198
Reject -- https://master.php.net/note/reject/71198
Search -- https://master.php.net/manage/user-notes.php