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 today

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

24

—

LowBetter than 31% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

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

462d 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

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M222](/packages/laravel-octane)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[civicrm/civicrm-core

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

751291.4k43](/packages/civicrm-civicrm-core)[botman/botman

Create messaging bots in PHP with ease.

6.2k1.6M98](/packages/botman-botman)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)

PHPackages © 2026

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