title: Thread Wrapper Class for a Function with variable arguments in PHP
body: <p>The idea here is to make a class that constructs with a function and an array of parameters and calls that function in a new thread.</p>
  
  <p>This is my class so far:</p>
  
  <pre><code>class FunctionThread extends Thread {
  
      public function __construct($fFunction, $aParameters){
  
          $this-&gt;fFunction = $fFunction;
          $this-&gt;aParameters = $aParameters;
      }
  
      public function run(){
  
          $this-&gt;fFunction($this-&gt;aParmeters[0], $this-&gt;aParmeters[1], ...);
      }
  }
  </code></pre>
  
  <p>Obviously the run function is incorrect, which brings me to my question:</p>
  
  <p>Assuming the array is guaranteed to have the proper number of elements to match the function that is being called, How can I call a function in PHP with an unknown number of arguments that are stored in an array?</p>
  
  <p>Edit:
  Also I have no access to the contents of the given function so it cannot be edited.</p>
  
  <p>Edit 2: I'm looking for something similar to scheme's curry function.</p>