Simple Parallel Processing in PHP with pcntl_fork()

Written by James Sinclair
on the 19th September 2013

For a recent project I needed to process some code in parallel. A colleague pointed me to the pcntl_fork() function, and it turns out it’s not quite as scary and complicated as I thought. So I turned the simple use case into a generic function. You use it something like this: