amphp/amp
A non-blocking concurrency framework for PHP applications.
v3.1.3
141M downloads/mo
#289 most downloaded on Packagist
amphp/amp
What this package is like to depend on
Last release 1 months ago
19 Jul 2026
Release timing varies
gaps range from 1 weeks to 1.3 years
Rarely documented
notes for 10 of 81 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
102 releases · first in 2013
3 releases in the last 12 months
see the full history below
Release timeline
102 releases · Aug 2013 to Jul 2026Releases
latest 60 of 102-
v3.1.319 Jul 2026Release notes
Open source →What's Changed
- Fixed garbage collection of the iterable returned from
Future::iterate()when the source iterable is aTraversable. Previously, iteration would continue even if the returned iterable was destroyed.
Full Changelog: v3.1.2...v3.1.3
- Fixed garbage collection of the iterable returned from
-
v3.1.221 Jun 2026Release notes
Open source →What's Changed
- Fixed detection of
AMP_DEBUGwhen set as a PHP constant when a falsey environmentAMP_DEBUGvalue is present - Forbid cloning and serialization of
Intervalto prevent cancellation of event-loop callbacks from the original object for cloning or arbitrary callbacks on deserialization
Full Changelog: v3.1.1...v3.1.2
- Fixed detection of
-
v3.1.127 Aug 2025Release notes
Open source →What's Changed
- Improve
weakClosure()signature by @vudaltsov in #452 - Use
str_increment()to fix PHP 8.5 deprecation by @nicolas-grekas in #456
New Contributors
- @vudaltsov made their first contribution in #452
Full Changelog: v3.1.0...v3.1.1
- Improve
-
v3.1.026 Jan 2025Release notes
Open source →What's Changed
- Add
Intervalby @trowski in #441 - Added a throwing
__unserializemethod toForbidSerializationto guard against malicious payloads unserializing to forbidden class instances.
New Contributors
- @gauthier-scano made their first contribution in #446
Full Changelog: v3.0.2...v3.1.0
- Add
-
v3.0.210 May 2024Release notes
Open source →What's Changed
- Changed
Closure(mixed...)annotation toClosure(...)to support PHPStan.
Full Changelog: v3.0.1...v3.0.2
- Changed
-
v3.0.118 Apr 2024Release notes
Open source →What's Changed
- Fixed compatibility of
Amp\weakClosure()with changes made to closure names in PHP 8.4.
Full Changelog: v3.0.0...v3.0.1
- Fixed compatibility of
-
v3.0.018 Dec 2022Release notes
Open source →Event Loop
Amp no longer ships its own event loop. It's now based on Revolt.
Revolt\EventLoopis quite similar to Amp's previousAmp\Loop. A very important difference is usingfloat $secondsinstead ofint $millisecondsfor timers though!Promises
Futureis a replacement for the previousPromise.
There's no need for callbacks oryieldanymore!
Itsawait()method is based on fibers and replaces generator based coroutines /Amp\Promise\wait().- Renamed
Amp\DeferredtoAmp\DeferredFuture. - Removed
Amp\Promise\wait(): UseAmp\Future::await()instead, which can be called in any (nested) context unlike before. - Removed
Amp\call(): Remove the passed closure boilerplate and allyieldkeywords, interruption is handled via fibers now instead of generator coroutines. - Removed
Amp\asyncCall(): Replace invocations withAmp\async(), which starts a new fiber instead of using generators. - Removed
Amp\coroutine(): There's no direct replacement. - Removed
Amp\asyncCoroutine(): There's no direct replacement. - Removed
Amp\Promise\timeout():Future::await()accepts an optionalCancellation, which can be used as a replacement. - Removed
Amp\Promise\rethrow(): Unhandled errors are now automatically thrown into the event loop, so there's no need for that function anymore. - Unhandled errors can be ignored using
Future::ignore()if needed, but should usually be handled in some way. - Removed
Amp\Promise\wrap(): UseFuture::finally()instead. - Renamed
Amp\getCurrentTime()toAmp\now()returning the time in seconds instead of milliseconds. - Changed
Amp\delay()to accept the delay in seconds now instead of milliseconds. - Added
Amp\weakClosure()to allow a class to hold a self-referencing Closure without creating a circular reference that prevents automatic garbage collection. - Added
Amp\trapSignal()to await one or multiple signals.
Promise Combinators
Promise combinators have been renamed:
Amp\Promise\race()has been renamed toAmp\Future\awaitFirst()Amp\Promise\first()has been renamed toAmp\Future\awaitAny()Amp\Promise\some()has been renamed toAmp\Future\awaitAnyN()Amp\Promise\any()has been renamed toAmp\Future\awaitAll()Amp\Promise\all()has been renamed toAmp\Future\await()
CancellationToken
CancellationTokenhas been renamed toCancellation.CancellationTokenSourcehas been renamed toDeferredCancellation.NullCancellationTokenhas been renamed toNullCancellation.TimeoutCancellationTokenhas been renamed toTimeoutCancellation.CombinedCancellationTokenhas been renamed toCompositeCancellation.SignalCancellationhas been added.
Iterators
Iterators have been removed from
amphp/ampas normal PHP iterators can be used with fibers now and there's no need for a separate API.
However, there's still some need for concurrent iterators, which is covered by the newamphp/pipelinelibrary now.Closable
Amp\Closablehas been added as a new basic interface for closable resources such as streams or sockets.Strict Types
Strict types now declared in all library files.
This will affect callbacks invoked within this library's code which use scalar types as parameters.
Functions used withAmp\async()are the most likely to be affected by this change — these functions will now be invoked within a strict-types context. - Renamed
-
v3.0.0-beta.1116 Dec 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.1006 Nov 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.912 Jul 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.825 Jun 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.714 Jun 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.620 Apr 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.503 Apr 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.416 Jan 2022 pre-releaseNothing published for this version
-
v3.0.0-beta.312 Dec 2021 pre-releaseNothing published for this version
-
v3.0.0-beta.203 Dec 2021 pre-releaseNothing published for this version
-
v3.0.0-beta.103 Dec 2021 pre-releaseNothing published for this version
-
v2.6.503 Sep 2025Release notes
Open source →What's Changed
- Use
str_increment()to fix PHP 8.5 deprecation by @nicolas-grekas in #457
Full Changelog: v2.6.4...v2.6.5
- Use
-
v2.6.421 Mar 2024Release notes
Open source → -
v2.6.321 Mar 2024Release notes
Open source →What's Changed
- Fix typos by @krsriq in #396
- Make implicit nullable types explicit by @nicolas-grekas in #431
New Contributors
- @krsriq made their first contribution in #396
- @nicolas-grekas made their first contribution in #431
Full Changelog: v2.6.2...v2.6.3
-
v2.6.220 Feb 2022Nothing published for this version
-
v2.6.123 Sep 2021Nothing published for this version
-
v2.6.016 Jul 2021Nothing published for this version
-
v2.5.210 Jan 2021Nothing published for this version
-
v2.5.103 Nov 2020Nothing published for this version
-
v2.5.014 Jul 2020Nothing published for this version
-
v2.4.430 Apr 2020Nothing published for this version
-
v2.4.319 Apr 2020Nothing published for this version
-
v2.4.204 Apr 2020Nothing published for this version
-
v2.4.110 Feb 2020Nothing published for this version
-
v2.4.011 Nov 2019Nothing published for this version
-
v2.3.226 Oct 2019Nothing published for this version
-
v2.3.101 Oct 2019Nothing published for this version
-
v2.3.001 Oct 2019Nothing published for this version
-
v2.2.121 Sep 2019Nothing published for this version
-
v2.2.002 Aug 2019Nothing published for this version
-
v2.1.231 May 2019Nothing published for this version
-
v2.1.111 Dec 2018Nothing published for this version
-
v2.1.010 Dec 2018Nothing published for this version
-
v2.0.730 Apr 2018Nothing published for this version
-
v2.0.627 Jan 2018Nothing published for this version
-
v2.0.519 Dec 2017Nothing published for this version
-
v2.0.405 Dec 2017Nothing published for this version
-
v2.0.307 Nov 2017Nothing published for this version
-
v2.0.219 Sep 2017Nothing published for this version
-
v2.0.109 Jul 2017Nothing published for this version
-
v2.0.015 Jun 2017Nothing published for this version
-
v2.0.0-RC409 Jun 2017 pre-releaseNothing published for this version
-
v2.0.0-RC324 May 2017 pre-releaseNothing published for this version
-
v2.0.0-RC216 May 2017 pre-releaseNothing published for this version
-
v2.0.0-RC104 May 2017 pre-releaseNothing published for this version
-
v1.2.212 May 2016Nothing published for this version
-
v1.2.112 May 2016Nothing published for this version
-
v1.2.011 May 2016Nothing published for this version
-
v1.1.111 May 2016Nothing published for this version
-
v1.1.009 Mar 2016Nothing published for this version
-
v1.0.822 Feb 2016Nothing published for this version
-
v1.0.709 Jan 2016Nothing published for this version
-
v1.0.616 Nov 2015Nothing published for this version