How can arguments to variadic functions be passed by reference in PHP?

There is no way of passing variable length argument lists by reference in PHP. It is a fundamental limitation of the language.

There is no way of passing variable length argument lists by reference in PHP. It is a fundamental limitation of the language. There is, however, a workaround with array(&$var1, &$var2...) syntax: Test could also be declared function test($args) but I wanted to illustrate that this works with the func_get_args() family of functions.It is the array(&$x) that causes the variable to be passed by reference, not the function signature.

From a comment on PHP's documentation on function arguments: php.net/manual/en/functions.arguments.php.

– Anthony Forloney Apr 10 '10 at 4:53 @anthony The former, thank you. – meagar Apr 10 '10 at 5:07 @meager, Not a problem, it's late over here was just curious if I had started to hallucinate. – Anthony Forloney Apr 10 '10 at 5:11 @meager: yeah, that's about the best I was able to come up with.

I was hoping (still am, really) that my imagination was failing me. – outis Apr 10 '10 at 22:04.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions