PHPackages                             duncan3dc/fork-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. duncan3dc/fork-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

duncan3dc/fork-helper
=====================

Simple class to fork processes in PHP and allow multi-threading

2.6.0(1mo ago)81574.0k↓62.6%24[2 issues](https://github.com/duncan3dc/fork-helper/issues)4Apache-2.0PHPPHP ^7.4 || ^8.0CI passing

Since Jun 8Pushed 3w ago8 watchersCompare

[ Source](https://github.com/duncan3dc/fork-helper)[ Packagist](https://packagist.org/packages/duncan3dc/fork-helper)[ Docs](https://github.com/duncan3dc/fork-helper)[ RSS](/packages/duncan3dc-fork-helper/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (14)Versions (21)Used By (4)

fork-helper
===========

[](#fork-helper)

Simple class to fork processes in PHP and allow multi-threading.

Full documentation is available at
PHPDoc API documentation is also available at [https://duncan3dc.github.io/fork-helper/api/](https://duncan3dc.github.io/fork-helper/api/namespaces/duncan3dc.Forker.html)

[![release](https://camo.githubusercontent.com/34371e14b5076513bdd516c8f146d2c8456559e9f764b0e36f6fcc7985dffe97/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f666f726b2d68656c7065722f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/fork-helper)[![build](https://github.com/duncan3dc/fork-helper/workflows/buildcheck/badge.svg?branch=main)](https://github.com/duncan3dc/fork-helper/actions?query=branch%3Amain+workflow%3Abuildcheck)[![coverage](https://camo.githubusercontent.com/14cbd4ccd0eaa14041e8394d4edcc377cfb541b3e6ab2f3a9e84c3ed52e8c4a5/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f666f726b2d68656c7065722f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/fork-helper)

Quick Example
-------------

[](#quick-example)

Run some code asynchronously:

```
$fork = new \duncan3dc\Forker\Fork;

$fork->call(function () {
    for ($i = 1; $i call(function () {
    for ($i = 1; $i < 3; $i++) {
        echo "Process B - " . $i . "\n";
        sleep(1);
    }
});

sleep(1);
echo "Waiting for the threads to finish...\n";
$fork->wait();
echo "End\n";
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since version 2.0.0

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](https//github.com/duncan3dc/fork-helper/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/fork-helper for enterprise
------------------------------------

[](#duncan3dcfork-helper-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/fork-helper and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-fork-helper?utm_source=packagist-duncan3dc-fork-helper&utm_medium=referral&utm_campaign=readme)

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance94

Actively maintained with recent releases

Popularity52

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~273 days

Recently: every ~710 days

Total

17

Last Release

30d ago

Major Versions

1.1.5 → 2.0.02016-10-16

1.1.6 → 2.1.02017-03-04

PHP version history (4 changes)1.0.1PHP &gt;=5.4.0

2.0.0PHP ^7.0

2.3.0PHP ^7.1

2.4.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (105 commits)")[![AndreySlashman](https://avatars.githubusercontent.com/u/7662900?v=4)](https://github.com/AndreySlashman "AndreySlashman (1 commits)")[![nightlinus](https://avatars.githubusercontent.com/u/2681887?v=4)](https://github.com/nightlinus "nightlinus (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![WINROL](https://avatars.githubusercontent.com/u/5067970?v=4)](https://github.com/WINROL "WINROL (1 commits)")

---

Tags

forkmulti-threadingphpmulti-threadingprocessforkcontrolpcntl

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duncan3dc-fork-helper/health.svg)

```
[![Health](https://phpackages.com/badges/duncan3dc-fork-helper/health.svg)](https://phpackages.com/packages/duncan3dc-fork-helper)
```

###  Alternatives

[react/child-process

Event-driven library for executing child processes with ReactPHP.

34691.0M159](/packages/react-child-process)[arara/process

Provides a better API to work with processes on Unix-like systems

16862.8k2](/packages/arara-process)[spatie/fork

A lightweight solution for running code concurrently in PHP

1.0k3.2M70](/packages/spatie-fork)[cocur/background-process

Start processes in the background that continue running when the PHP process exists.

2982.0M12](/packages/cocur-background-process)[kartik-v/yii2-datecontrol

Date control module allowing separation of formats for View and Model for Yii Framework 2.0

551.6M39](/packages/kartik-v-yii2-datecontrol)[lifo/php-ipc

Simple PHP Inter Process Communication (IPC) library

285.6k](/packages/lifo-php-ipc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
