Is it possible to create a PHP function that takes a variable number of parameters all of them by reference?
It doesn't help me a function that receives by reference an array of values nor a function that takes its arguments wrapped in an object because I'm working on function composition and argument binding. Don't think about call-time pass-by-reference either. That thing shouldn't even exist.
PHP 5.6 introduced new variadic syntax which supports pass-by-reference. (thanks @outis for the update)
For PHP 5.5 or lower you can use the following trick:
The downside is that number of arguments is limited by the number of arguments defined (6 in the example snippet). but with the func_num_args() you could detect if more are needed.
Passing more than 7 parameters to a function is bad practice anyway ;)