Call function dynamically, regardless of being instance method or static?
<p>I need to be able to call a method without having to know whether or not it is static.</p>

<p>For example, this doesn't work and I would like it to:</p>

<pre><code>class Groups {
    public function fetchAll($arg1, $arg2){
        return $this-&gt;otherFunction();
    }
    public static function alsoFetchAll($arg1, $arg2){}
}

$arguments = array('one', 'two');
$result = call_user_func_array(array('Groups', 'fetchAll'), $arguments);
$result = call_user_func_array(array('Groups', 'alsoFetchAll'), $arguments);
</code></pre>

<p>I'm getting an error for the instance varirable:</p>

<pre><code>Fatal error: Using $this when not in object context
</code></pre>

<p>The reason it doesn't work is because I need to instantiate the class for the instance variables to work. But my constructor doesn't take any arguments so I want a quick way to skip this step.</p>

<p>How can I write this so that it doesn't matter what kind of method it is?</p>
