XmisterIS
01-20-2012, 03:23 PM
Consider the following code:
function myfunc($a, $b, $c)
{
$args =& func_get_args();
$args[0] = 1;
echo implode(", ", array($a, $b, $c)).PHP_EOL;
}
myfunc(2, 2, 3);
This outputs 2, 2, 3. Is there a built-function, akin to func_get_args, which returns an array of references to the function arguments, rather than copies? I can't find anything in the manual, but perhaps I'm looking in the wrong place!
function myfunc($a, $b, $c)
{
$args =& func_get_args();
$args[0] = 1;
echo implode(", ", array($a, $b, $c)).PHP_EOL;
}
myfunc(2, 2, 3);
This outputs 2, 2, 3. Is there a built-function, akin to func_get_args, which returns an array of references to the function arguments, rather than copies? I can't find anything in the manual, but perhaps I'm looking in the wrong place!