How to count the arguments of a method before calling that method wich is inside a class?
<p>My question is pretty much like this one : <a href="http://stackoverflow.com/questions/4580619/php-get-argument-count">PHP: Get argument count</a></p>

<p>Except that I need to count the parameters (arguments if you prefer) of a method, but this method is inside a object.</p>

<p>I Tried this:</p>

<pre><code>    $reflection = new ReflectionFunction($_SITE,$acao);
    $qtdArgumentos = $reflection-&gt;getNumberOfParameters();
</code></pre>

<p>and this :</p>

<pre><code>    $reflection = new ReflectionFunction($_SITE-&gt;$acao);
    $qtdArgumentos = $reflection-&gt;getNumberOfParameters();
</code></pre>

<p>and got this error :</p>

<p>Fatal error: Uncaught exception 'ReflectionException' with message 'Function $<em>SITE,$acao() does not exist' in C:\wamp\www\project\index.php:20 Stack trace: #0 C:\wamp\www\project\index.php(20): ReflectionFunction-></em>_construct('$_SITE,$acao') #1 {main} thrown in C:\wamp\www\projeto\index.php on line 20</p>

<p>Does anyone knows another way to count the number of arguments of a method is inside a object or a workaround for my code ?</p>
