不带call_user_func_array()传递可变数量的参数

I have a code problem which stems from the fact that I am using certain libraries of code I cannot change.

I use the following code to pass execution of any undefined methods to another class, and it works fine but it seems like a waste doubling up.

Any suggestions?

Basically I want to know if it's possible to pass an unknown number of parameters to a method (without using call_user_func_array(), just in case they need to be passed by reference). I am not asking how to use func_get_args(), rather the reverse.

Or should I just allow for a few more arguments in the first logic path (the list() code)?

class Foo {
    __construct() {
        $this->external = new ClassThatIHaveNoControlOver();
    }

    function bar($name) {
        return 'Hi '.$name;
    }

    function __call($method, $arguments) {
        if (count($arguments) < 3) {
            // call_user_func_array won't pass by reference, as required by
            // ClassThatIHaveNoControlOver->foobar(), so calling the function
            // directly for up to 2 arguments, as I know that foobar() will only
            // take 2 arguments
            list($first, $second) = $arguments + Array(null, null);
            return $this->external->$method($first, $second);
        } else {
            return call_user_func_array(array($this->external, $method), $arguments);
        }
    }
}

$foo = new Foo();

$firstName = 'Bob';
$lastName = 'Brown';
echo $foo->bar($firstName); // returns Hi Bob as expected
echo $foo->foobar($firstName, $lastName); // returns whatever
        // ClassThatIHaveNoControlOver()->foobar() is meant to return

EDIT Just to clarify, I know I can use this method to rejig the parameters as references, but that would mean passing everything as a reference, even if the method didn't require it - something I was trying to avoid, but seems unlikely at the moment.

As commented in the thread question post's comments this is an example and not necessarily (likely) best practice.

//Some vars
$foo = "shoe";
$bar = "bucket";

//Array of references
$arr = Array(&$foo, &$bar);

//Show that changing variable value affects array content
$foo = "water";
echo $arr[0];

//Sample function
function fooBar($a)
{
    $a[0] = "fire";
}
//Call sample function
call_user_func("fooBar",$arr);

//Show that function changes both array contents and variable value by reference
echo $arr[0];
echo $foo;

Expanding a bit on the discussion, again not the most industry standard approach but it'll do the job.

function pushRefOnArray(&$arr, &$var, $key = false)
{
    if(isset($key))
        $arr[$key] = &$var;
    else
        $arr[] = &$var;
}

Essentially you can dynamically build your array and call pushRefToArray() any time you need to pass an item to be passed as reference rather than by value.

You could use something like this:

public function __call($method, $params = array()) {
    switch (count($params)) {
        case 0:
            return $this->external->{$method}();
        case 1:
            return $this->external->{$method}($params[0]);
        case 2:
            return $this->external->{$method}($params[0], $params[1]);
        case 3:
            return $this->external->{$method}($params[0], $params[1], $params[2]);
        default:
            return call_user_func_array(array(&this->external, $method), $params);
    }
}