PHPackages                             reactphp-x/serializable-closure - 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. reactphp-x/serializable-closure

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

reactphp-x/serializable-closure
===============================

v1.0.0(1y ago)031MITPHP

Since Mar 29Pushed 1y agoCompare

[ Source](https://github.com/reactphp-x/serializable-closure)[ Packagist](https://packagist.org/packages/reactphp-x/serializable-closure)[ RSS](/packages/reactphp-x-serializable-closure/feed)WikiDiscussions master Synced 1mo ago

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

ReactphpX SerializableClosure
=============================

[](#reactphpx-serializableclosure)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

简介
--

[](#简介)

ReactphpX SerializableClosure 是一个基于 Laravel SerializableClosure 的 PHP 闭包序列化工具，专为 ReactPHP 生态设计。

安装
--

[](#安装)

使用 Composer 安装:

```
composer require reactphp-x/serializable-closure
```

使用示例
----

[](#使用示例)

```
use ReactphpX\SerializableClosure\SerializableClosure;

// 序列化闭包
$closure = function() {
    return "Hello World";
};

$serialized = SerializableClosure::serialize($closure);

// 反序列化闭包
$unserialized = SerializableClosure::unserialize($serialized);

echo $unserialized(); // 输出: Hello World

// 使用密钥加密
$secretKey = 'your-secret-key';
$serialized = SerializableClosure::serialize($closure, $secretKey);
$unserialized = SerializableClosure::unserialize($serialized, $secretKey);
```

贡献
--

[](#贡献)

欢迎提交 Pull Request 或报告问题。

许可证
---

[](#许可证)

MIT 许可证。详见 [LICENSE](LICENSE) 文件。

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance46

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

415d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76907477?v=4)[wpjscc](/maintainers/wpjscc)[@wpjscc](https://github.com/wpjscc)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/reactphp-x-serializable-closure/health.svg)

```
[![Health](https://phpackages.com/badges/reactphp-x-serializable-closure/health.svg)](https://phpackages.com/packages/reactphp-x-serializable-closure)
```

###  Alternatives

[botman/botman

Create messaging bots in PHP with ease.

6.2k1.5M97](/packages/botman-botman)[tabuna/breadcrumbs

An easy way to add breadcrumbs to your Laravel app.

4163.4M13](/packages/tabuna-breadcrumbs)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[amphp/parallel-functions

Parallel processing made simple.

27910.3M26](/packages/amphp-parallel-functions)[laravie/serialize-queries

Serializable Laravel Query Builder

707.1M4](/packages/laravie-serialize-queries)[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)

PHPackages © 2026

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