In this example, it shows how to use a threaded with a pool to get an array of results, using pThreads v3.2.1 and php 7.3.23 <?php class TestWork extends Threaded { //updated version that works with pThreads v3.2.1 and php 7.3.23 protected $complete; //$pData is the data sent to your worker thread to do it's job. public function __construct($pData) { //transfer all the variables to local variables