this is the function:
public function func(&$parameters = array())
{
}
now I need to do this:
$x->func (get_defined_vars());
but that fails. Another way:
$x->func (&get_defined_vars());
it drops an error: Can’t use function return value in write context in …
Then how to do it?
get_defined_vars()returns an array, not a variable. As you can only pass variables by reference you need to write:Though I don’t really see a reason to pass the array by reference here. (If you are doing this for performance, don’t do it, as it won’t help.)