title: Running async function in php
body: <p>is it possible to create some php class which can run functions asynchronously? Here is what I have done so far:</p>
  
  <pre><code>class Worker extends Thread
  {
      protected  $asyncFun;
      protected $paramsArray;
  
      public function run() {
          $asyncFun(/*parameters go here*/)
      }
  
      public function setAsyncFunction($func, $paramsArr)
      {
          $this-&gt;asyncFun = $func;
          $this-&gt;paramsArray = $paramsArr;
      }
  }
  </code></pre>
  
  <p>Here is how I want to call it:</p>
  
  <pre><code>$worker = new Worker();
  $worker-&gt;setAsyncFunction(foo, ["a", "b"]);
  $worker::start();
  </code></pre>