title: Instantiating classes with params in singleton factory
body: <p>I have a class that produces singleton classes. <em>(Note that this is overly simplified code for the purpose of this question, for example it doesn't check that the filepath exists)</em></p>
  
  <pre><code>class Singleton
  {
     public function Load($classname, $params)
     {
        $filepath = 'classes/'.$classname.'.php';
        require_once($filepath);
        return $classname();
     }
  
  }
  </code></pre>
  
  <p>Now say that I wanted to pass an array of parameters that can vary in size to the constructor of the class being created. What is the best way to do this? I envision something along the lines of <code>call_user_func_array</code> but for classes?</p>