To start with multi-threading, you would need the pthreads-ext for php, which can be installed by
$ pecl install pthreads
and adding the entry to php.ini.
A simple example:
<?php
// NOTE: Code uses PHP7 semantics.
class MyThread extends Thread {
/**
* @var string
* Variab...