# spatie/fork

> A lightweight solution for running code concurrently in PHP

Navigation: [Developer Tools](category/developer-tools.txt) · [Index](../llms.txt)

## Facts

- GitHub: https://github.com/spatie/fork
- HTML: https://awesomeopensource.dev/project/spatie-fork
- Website: https://spatie.be/open-source
- License: MIT
- Language: PHP
- stars: 1049
- Topics: async, concurrent, performance, php
- Activity score: 4.8/5 (Thriving)
- Last commit (any branch): 2026-11-06
- Last release: 1.4.0 2026-11-06

## Description

Runs PHP closures concurrently by forking the main process into child tasks, returning their results in the order the closures were passed. It supports before and after hooks in both parent and child, a concurrency limit, exception capture with a catch callback, ordered completion callbacks, and pcntl_alarm-based timeouts, with serialized return values including objects. It requires PHP 8 and the pcntl extension and works only in CLI processes, not in a web context.

## Maintenance activity

- Recency: 94% (weight 40%) — last commit: 7 days ago
- Commit volume: 92% (weight 25%)
- Releases: 99% (weight 25%) — last release: 7 days ago
- Bug fixes: 100% (weight 10%)
- Commits: 40 / 90d, 47 / 365d

## Demo video

https://www.youtube.com/watch?v=IJXzc46MFPM

## Similar projects

- [stablyai/orca](stablyai-orca.md): Run several coding agents in parallel, each in its own Git worktree · Activity score 5.0/5 (Thriving)
- [tauri-apps/tauri](tauri-apps-tauri.md): Build small desktop and mobile apps with a web frontend and a Rust core · Activity score 5.0/5 (Thriving)
- [microsoft/terminal](microsoft-terminal.md): Tabs, panes and GPU rendering for PowerShell, cmd, WSL and SSH on Windows · Activity score 5.0/5 (Thriving)
- [ant-design/ant-design](ant-design-ant-design.md): A UI Design Language. · Activity score 5.0/5 (Thriving)
- [microsoft/playwright](microsoft-playwright.md): End-to-end testing and browser automation across Chromium, Firefox and WebKit · Activity score 5.0/5 (Thriving)
- [nvm-sh/nvm](nvm-sh-nvm.md): POSIX shell script for installing and switching between Node.js versions · Activity score 5.0/5 (Thriving)
