Re: variable-length arguments passed by reference... how?
| From: | Marek Kilimajer | Date: | Thu, 29 Apr 2004 15:56:33 +0000 |
| Subject: | Re: variable-length arguments passed by reference... how? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184958@lists.php.net to get a copy of this message | ||
But workaround would be to call your function with array():
function f($a) {
foreach($a as $k => $v) $a[$k] = $v+1;
}
$a = 1;
$b = 2;
f(array(&$a, &$b));
echo "$a $b";
Aric Caley wrote:
I want to create a function similar to the MySqli extensions' mysqli_stmt_bind_param() function. I assume that this function takes its arguments passed by reference. Now, I know how to do variable length argument lists in a function with func_get_arg(s) but how do I tell it that they are to be passed by reference? I'm using PHP5 and I want to stick by the latest recomendations..