PHPackages                             proteins/deferred - 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. proteins/deferred

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

proteins/deferred
=================

Ensure deferred execution of code, even in case of fatal error.

1.0.3(6y ago)04MITPHPPHP ^7.2

Since May 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/php-protein/deferred)[ Packagist](https://packagist.org/packages/proteins/deferred)[ RSS](/packages/proteins-deferred/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

[![](https://raw.githubusercontent.com/php-protein/docs/master/assets/protein-large.png)](https://raw.githubusercontent.com/php-protein/docs/master/assets/protein-large.png)

Protein | Deferred
==================

[](#protein--deferred)

Ensure deferred execution of code, even in case of fatal error.
---------------------------------------------------------------

[](#ensure-deferred-execution-of-code-even-in-case-of-fatal-error)

### Install

[](#install)

---

```
composer require proteins/deferred

```

Require the class via :

```
use Proteins\Deferred;
```

### Run code at function end or in case of error.

[](#run-code-at-function-end-or-in-case-of-error)

---

The passed callback will be queued for execution on Deferred object destruction.

```
function duel(){
	echo "A: I will have the last word!\n";

	echo "B: Wanna bet?\n";

	$defer_B_last_word = new Deferred(function(){
		echo "B: Haha! Gotcha!\n";
	});

	die("A: I WIN!\n"); // Hahaha!

	echo "B: WUT?\n";
}

duel();
```

```
A: I will have the last word!
B: Wanna bet?
A: I WIN!
B: Haha! Gotcha!

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

2543d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00a7323d0ef535e352696bc141305b3928fce777a0f477109d2274ad17cdb9f?d=identicon)[lastguest](/maintainers/lastguest)

---

Top Contributors

[![lastguest](https://avatars.githubusercontent.com/u/178900?v=4)](https://github.com/lastguest "lastguest (4 commits)")

### Embed Badge

![Health badge](/badges/proteins-deferred/health.svg)

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

###  Alternatives

[myxtype/eos-client

php eos client offline sign eosphp-ecc

462.1k](/packages/myxtype-eos-client)

PHPackages © 2026

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