NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1575 most downloaded on Packagist
A lightweight solution for running code concurrently in PHP
Latest stable
1.4.0
Last release 16 days ago
06 Nov 2026
Release timing varies
gaps range from 2 weeks to 12 months
Most releases are documented
notes for 21 of 26 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
26 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
Add Fork::afterWithOrder(child: ..., parent: ...) to receive each task's output and zero-based position in run(), matching result keys even when tasks
Fork::afterWithOrder(child: ..., parent: ...) to receive each task's output and zero-based position in run(), matching result keys even when tasks finish out of order or are queued by a concurrency limit (#98).after() callbacks. When both are registered, the existing callback runs first in each process. Re-registering afterWithOrder() replaces its callbacks; calling it without arguments clears them.catch(). Child callbacks receive the raw output sent to the parent, just like existing child after() callbacks.after() callbacks still receive exactly one argument. Internal functions, optional parameters and variadic callbacks retain their existing behavior; task order is explicitly opt-in.Full Changelog: https://github.com/spatie/fork/compare/1.3.0...1.4.0
Opt-in Fork::catch(callable $callback) to handle task exceptions in the parent process. The callback receives the exception and zero-based task order;
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Fork::catch(callable $callback) to handle task exceptions in the parent process. The callback receives the exception and zero-based task order; its return value becomes the task result and reaches after(parent: ...) (#99).Spatie\Fork\Exceptions\TaskFailed, preserving their original class, message, file, line and trace text.before/after callback signatures are unchanged. Without catch(), existing output and exception behavior is unchanged.catch() handles task execution and return-value serialization, not before/after callbacks, parent-side result restoration, transfer failures or unexpected child exit statuses. Exceptions thrown by the catch callback propagate from run().Full Changelog: https://github.com/spatie/fork/compare/1.2.12...1.3.0
Restore the application's previous SIGINT, SIGTERM and SIGQUIT handlers when run() returns or throws an exception (#100).
SIGINT, SIGTERM and SIGQUIT handlers when run() returns or throws an exception (#100).run() are unchanged. Signals are not forwarded to application handlers while tasks are running.Full Changelog: https://github.com/spatie/fork/compare/1.2.11...1.2.12
Report incomplete child-result transfers with the existing CouldNotManageTask exception instead of returning truncated strings or invalid serialized d
CouldNotManageTask exception instead of returning truncated strings or invalid serialized data (#102).Full Changelog: https://github.com/spatie/fork/compare/1.2.10...1.2.11
Fix stopped child tasks being treated as finished: a child stopped with SIGSTOP and later resumed with SIGCONT is now awaited until it actually termin
SIGSTOP and later resumed with SIGCONT is now awaited until it actually terminates, preserving its output. Thanks @specialtactics for the contribution in https://github.com/spatie/fork/pull/97.Full Changelog: https://github.com/spatie/fork/compare/1.2.9...1.2.10
Fail immediately when a child process cannot be forked instead of storing -1 as a task PID and potentially waiting for another child in https://github
-1 as a task PID and potentially waiting for another child in https://github.com/spatie/fork/pull/101.before / after callbacks in https://github.com/spatie/fork/pull/95, and retain Spatie-hosted README images.Full Changelog: https://github.com/spatie/fork/compare/1.2.8...1.2.9
Fix TypeError from socket_create_pair() when Swoole runtime hooks are enabled (#93) in #94
TypeError from socket_create_pair() when Swoole runtime hooks are enabled (#93) in #94Full Changelog: https://github.com/spatie/fork/compare/1.2.7...1.2.8
Replace php-cs-fixer with Laravel Pint
Task::execute() return type (string instead of string|bool)Full Changelog: https://github.com/spatie/fork/compare/1.2.6...1.2.7
Fix truncation of large payloads by @obelloc in #83
Full Changelog: https://github.com/spatie/fork/compare/1.2.5...1.2.6
Fix task exit status handling, uniformize process exit method and tests by @jchambon-equativ in https://github.com/spatie/fork/pull/74
Full Changelog: https://github.com/spatie/fork/compare/1.2.4...1.2.5
[REMOVE] PHP 8.4 deprecation warnings by @yabooodya in https://github.com/spatie/fork/pull/66
Full Changelog: https://github.com/spatie/fork/compare/1.2.3...1.2.4
Add a test to verify that child processes are isolated by @ahmadreza1383 in https://github.com/spatie/fork/pull/64
Full Changelog: https://github.com/spatie/fork/compare/1.2.2...1.2.3
Switch from kill-all-exit to a normal exit when a child is done by @puggan in https://github.com/spatie/fork/pull/51
Full Changelog: https://github.com/spatie/fork/compare/1.2.1...1.2.2
Kill any forked tasks when force closed in terminal by @stevebauman in https://github.com/spatie/fork/pull/48
Full Changelog: https://github.com/spatie/fork/compare/1.2.0...1.2.1
Listen signals for terminating process by @zKoz210 in https://github.com/spatie/fork/pull/42
Full Changelog: https://github.com/spatie/fork/compare/1.1.3...1.2.0
Refactor tests to Pest by @alexmanase in https://github.com/spatie/fork/pull/33
Full Changelog: https://github.com/spatie/fork/compare/1.1.2...1.1.3
fixes socket_select interrupted exception by @henzeb in https://github.com/spatie/fork/pull/32
Full Changelog: https://github.com/spatie/fork/compare/1.1.1...1.1.2
Proper handling of timeout microseconds
Add Fork::concurrent(int $concurrent)
Fork::concurrent(int $concurrent) (#10)- Add check for pcntl support
- Initial release
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.