A really basic multithreading example when using Swoole PHP.
An example of using a thread pool for handling threads more efficiently.
This tutorial will show you how to recompile PHP with ZTS enabled, before then adding the pthreads extension in order for us to be able to easily write multithreaded PHP CLI scripts.