PHPackages                             duc\_cnzj/defer - 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. duc\_cnzj/defer

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

duc\_cnzj/defer
===============

Package description here.

v2.0.1(6y ago)0143MITPHP

Since Jan 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/DuC-cnZj/defer)[ Packagist](https://packagist.org/packages/duc_cnzj/defer)[ RSS](/packages/duc-cnzj-defer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

 php defer
===========

[](#-php-defer-)

[![Build Status](https://camo.githubusercontent.com/819906c694ec60dd4d1b9ed4e6cfc5d3ace76afb10d99d27c3c599621f694315/687474703a2f2f64642e77686f6f70732d636e2e636c75622f6170692f6261646765732f4475432d636e5a6a2f64656665722f7374617475732e737667)](http://dd.whoops-cn.club/DuC-cnZj/defer)

> 在php中实现go/defer，略微有点不一样

Installing
----------

[](#installing)

```
composer require duc_cnzj/defer
```

Usage
-----

[](#usage)

```
$t = time();
defer(function () use($t) {
    echo time()-$t."\n";
}, $_);
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/duccnzj/defer/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/duccnzj/defer/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~15 days

Total

5

Last Release

2247d ago

Major Versions

v1.1.1 → v2.0.02020-03-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23514869?v=4)[duc](/maintainers/DuC-cnZj)[@duc-cnzj](https://github.com/duc-cnzj)

---

Top Contributors

[![duc-cnzj](https://avatars.githubusercontent.com/u/23514869?v=4)](https://github.com/duc-cnzj "duc-cnzj (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/duc-cnzj-defer/health.svg)

```
[![Health](https://phpackages.com/badges/duc-cnzj-defer/health.svg)](https://phpackages.com/packages/duc-cnzj-defer)
```

###  Alternatives

[aristath/ari-color

A PHP library for color manipulation in themes and plugins

6128.6k](/packages/aristath-ari-color)[symfony/ux-notify

Native notification integration for Symfony

1274.7k](/packages/symfony-ux-notify)[thestringler/manipulator

An OOP approach to string manipulation.

345.5k2](/packages/thestringler-manipulator)[hauntd/yii2-vote

Votes, likes, favorites.

383.1k](/packages/hauntd-yii2-vote)

PHPackages © 2026

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