title: PHP Generate Dynamic Function calls array
body: <p>I am using php laravel threading using octane and swoole server for concurrent processing.</p>
  <p>when I pass static process function list as below it works.</p>
  <pre><code>$ArrayProcess = [
              fn () =&gt; $this-&gt;getPropertyData(),
              fn () =&gt; $this-&gt;getPropertyData(),
              fn () =&gt; $this-&gt;getPropertyData()
          ];
          try {
              $result = Octane::concurrently($ArrayProcess, 200000);
              print_r(json_encode($result));
          } catch (\Exception $e) {
              print_r($e-&gt;getLine() . ':' . $e-&gt;getMessage() . ' ');
              dd($e-&gt;getTrace());
          }
  </code></pre>
  <p><strong>Output of above</strong></p>
  <pre><code>array:3 [▼
    0 =&gt; Closure() {#552 ▼
      class: &quot;App\Http\Controllers\OctaneController&quot;
      this: App\Http\Controllers\OctaneController {#489 …}
      file: &quot;/home/devbooki/public_html/app/Http/Controllers/OctaneController.php&quot;
      line: &quot;72 to 72&quot;
    }
    1 =&gt; Closure() {#543 ▼
      class: &quot;App\Http\Controllers\OctaneController&quot;
      this: App\Http\Controllers\OctaneController {#489 …}
      file: &quot;/home/devbooki/public_html/app/Http/Controllers/OctaneController.php&quot;
      line: &quot;73 to 73&quot;
    }
    2 =&gt; Closure() {#547 ▼
      class: &quot;App\Http\Controllers\OctaneController&quot;
      this: App\Http\Controllers\OctaneController {#489 …}
      file: &quot;/home/devbooki/public_html/app/Http/Controllers/OctaneController.php&quot;
      line: &quot;74 to 75&quot;
    }
  ]
  </code></pre>
  <p>but when I am trying to generate process array dynamically it is not working.</p>
  <pre><code>$ArrayProcess = [];
  foreach ($PropertyData as $PD) {
     $ArrayProcess[] = fn () =&gt; $this-&gt;getPropertyData();
  }
  $PropertyData = Octane::concurrently($ArrayProcess, 200000);
  </code></pre>
  <p><strong>Output of above</strong></p>
  <pre><code>[[{},{},{},{}]]
  
  </code></pre>
  <p>Please suggest way how to generate process array dynamically.</p>
  <p>Thanks in advance.</p>