Get amount of function arguments OUTSITE in php
<p>I need to know, how much arguments a function accepts (including optional args). w/o calling that function and w/o getting errors. Like I can check with <code>is_callable</code> before I call a function in order to not get php error.<br>
For example, in javascript every function have a <code>length</code> property:</p>

<pre><code>Math.sin.length == 1
Array.prototype.slice.length == 2
</code></pre>

<p>I know, this will return only declared arguments, but there's no support for optional arguments with default values in js syntax.</p>

<p>Is there a similar thing in <strong>php</strong>?<br>
Working in php 5.2+ is enough. Wroking for only global functions (not methods) is also enough.<br>
Hackish solutions like trying to call function with 0 args, then with 1 arg... are highly discouraged, cause function call cost may be very high.</p>
