PHPackages                             internal/promise - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. internal/promise

ActiveLibrary[Queues &amp; Workers](/categories/queues)

internal/promise
================

A lightweight implementation of CommonJS Promises/A for PHP

3.4.1(6mo ago)52798.4k↓26.9%11MITPHPPHP &gt;=8.1.0CI passing

Since Aug 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/php-internal/promise)[ Packagist](https://packagist.org/packages/internal/promise)[ RSS](/packages/internal-promise/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (7)Used By (1)

Promise
=======

[](#promise)

A lightweight implementation of [CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP.

Note

This is a fork of [reactphp/promise](https://github.com/reactphp/promise).

Improvements over original reactphp/promise:

- PHP 8.1+ compatibility
- `declare(strict_types=1);` in all PHP files
- `@yield` annotation in the PromiseInterface

Version 3.x specific:

- Replaces `react/promise` v3 in Composer
- Rejection handler is reusable now. `error_log()` is still used by default.
- Removed `exit(255)` from RejectionPromise.

Version 2.x specific:

- Replaces `react/promise` v2 in Composer
- Enhanced type annotations

Install
-------

[](#install)

```
composer require internal/promise
```

[![PHP](https://camo.githubusercontent.com/d89abd10e0efe5df961c8dcf9c7ee1796981b00ceea9559d9130b7dadfc08d68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696e7465726e616c2f70726f6d6973652e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://packagist.org/packages/internal/promise)[![Latest Version on Packagist](https://camo.githubusercontent.com/289fd1cb1012d9545e7f9a931b9396c28876cf7ddd149932ce0f9a708ab4fc67/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e7465726e616c2f70726f6d6973652e7376673f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/internal/promise)[![License](https://camo.githubusercontent.com/c9c4f97943cd989ab427be1d484aac2ec45088eaf39ec27fd652880e07f467fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696e7465726e616c2f70726f6d6973652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/2a2fac50dabbfe8ac4e889dd7e3b6e81f8eef0f1642f97d8b8059e984d6d0c45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e7465726e616c2f70726f6d6973652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/internal/promise)

Tests
-----

[](#tests)

To run the test suite, go to the project root and run:

```
composer test
```

On top of this, we use PHPStan on max level to ensure type safety across the project:

```
composer stan
```

Credits
-------

[](#credits)

This fork is based on [reactphp/promise](https://github.com/reactphp/promise), which is a port of [when.js](https://github.com/cujojs/when)by [Brian Cavalier](https://github.com/briancavalier).

Also, large parts of the [documentation](documentation.md) have been ported from the when.js [Wiki](https://github.com/cujojs/when/wiki) and the [API docs](https://github.com/cujojs/when/blob/master/docs/api.md).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance73

Regular maintenance activity

Popularity51

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.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 ~25 days

Recently: every ~38 days

Total

7

Last Release

112d ago

Major Versions

2.12.1 → 3.4.02025-08-27

2.x-dev → 3.x-dev2026-01-26

PHP version history (2 changes)2.12.0PHP &gt;=8.1

3.4.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/110fa17dca123e71e4ef4132d1d6a66d20058a07fc6118e716dd67dd4316e886?d=identicon)[roxblnfk](/maintainers/roxblnfk)

---

Top Contributors

[![jsor](https://avatars.githubusercontent.com/u/55574?v=4)](https://github.com/jsor "jsor (351 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (51 commits)")[![clue](https://avatars.githubusercontent.com/u/776829?v=4)](https://github.com/clue "clue (50 commits)")[![igorw](https://avatars.githubusercontent.com/u/88061?v=4)](https://github.com/igorw "igorw (26 commits)")[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (22 commits)")[![SimonFrings](https://avatars.githubusercontent.com/u/44357440?v=4)](https://github.com/SimonFrings "SimonFrings (15 commits)")[![cboden](https://avatars.githubusercontent.com/u/617694?v=4)](https://github.com/cboden "cboden (4 commits)")[![nhedger](https://avatars.githubusercontent.com/u/649677?v=4)](https://github.com/nhedger "nhedger (3 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (3 commits)")[![bzikarsky](https://avatars.githubusercontent.com/u/225374?v=4)](https://github.com/bzikarsky "bzikarsky (3 commits)")[![cdosoftei](https://avatars.githubusercontent.com/u/7636091?v=4)](https://github.com/cdosoftei "cdosoftei (2 commits)")[![s-bronstein](https://avatars.githubusercontent.com/u/13821666?v=4)](https://github.com/s-bronstein "s-bronstein (2 commits)")[![theodorejb](https://avatars.githubusercontent.com/u/3053271?v=4)](https://github.com/theodorejb "theodorejb (1 commits)")[![woodongwong](https://avatars.githubusercontent.com/u/9292647?v=4)](https://github.com/woodongwong "woodongwong (1 commits)")[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (1 commits)")[![danielecr](https://avatars.githubusercontent.com/u/2484638?v=4)](https://github.com/danielecr "danielecr (1 commits)")[![joshdifabio](https://avatars.githubusercontent.com/u/5609851?v=4)](https://github.com/joshdifabio "joshdifabio (1 commits)")[![KorDum](https://avatars.githubusercontent.com/u/1331559?v=4)](https://github.com/KorDum "KorDum (1 commits)")[![Kubo2](https://avatars.githubusercontent.com/u/6882599?v=4)](https://github.com/Kubo2 "Kubo2 (1 commits)")[![miguilimzero](https://avatars.githubusercontent.com/u/35383529?v=4)](https://github.com/miguilimzero "miguilimzero (1 commits)")

---

Tags

promisepromises

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/internal-promise/health.svg)

```
[![Health](https://phpackages.com/badges/internal-promise/health.svg)](https://phpackages.com/packages/internal-promise)
```

###  Alternatives

[react/promise

A lightweight implementation of CommonJS Promises/A for PHP

2.5k361.9M563](/packages/react-promise)[amphp/amp

A non-blocking concurrency framework for PHP applications.

4.4k123.4M323](/packages/amphp-amp)[php-http/promise

Promise used for asynchronous HTTP requests

1.8k308.8M32](/packages/php-http-promise)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34141.9M96](/packages/react-promise-timer)[sabre/event

sabre/event is a library for lightweight event-based programming

35227.4M25](/packages/sabre-event)[icicleio/icicle

Icicle is a PHP library for writing asynchronous code using synchronous coding techniques.

1.1k150.9k14](/packages/icicleio-icicle)

PHPackages © 2026

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