Can a method with an unknown number of arguments call another method with an unknown number of arguments?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2126778/php-how-to-pass-func-get-args-values-to-another-function-as-list-of-arguments">PHP, how to pass func-get-args values to another function as list of arguments?</a>  </p>
</blockquote>



<p>I have a method in a base class that can take any number of arguments. This method needs to call a method of a third-party object which can take any number of arguments using those passed to the first method.</p>

<p>I mention that it is a third-party object that is to be called to reinforce the constraint that the called method's signature cannot be modified to accept an array or object.</p>

<p>Example:</p>

<pre><code>&lt;?php
class Example {     

    private $thirdPartyObject = null;

    public function methodOne() {
        $arguments = func_get_args();

        $this-&gt;thirdPartyObject = new ThirdPartyObject();
        $this-&gt;externalObject-&gt;methodName(/* pass on variable number of arguments here */);
    }
}

$exampleObject = new Example();
$exampleObject-&gt;methodOne('a', 'b', 'c');
</code></pre>

<p><br />
If we know in advance the number of arguments being passed to <code>Example-&gt;methodOne()</code> we could then pass on the same number of arguments to <code>ThirdPartyObject-&gt;methodName()</code>.</p>

<p>If we do not know in advance the number of arguments being passed to <code>Example-&gt;methodOne()</code>, can we pass these arguments on to <code>ThirdPartyObject-&gt;methodName()</code>?</p>

<p>In this case, <code>ThirdPartyObject-&gt;methodName()</code> is called with one or more arguments such as:</p>

<pre><code>&lt;?php
$thirdPartyObject = new ThirdPartyObject();
$thirdPartyObject-&gt;methodName('a');
$thirdPartyObject-&gt;methodName('a', 'b');
$thirdPartyObject-&gt;methodName('a', /* ... */, 'N');
</code></pre>
