PHPackages                             workbunny/pjson - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. workbunny/pjson

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

workbunny/pjson
===============

PJson is used to parse JSON data and provide efficient memory management optimization

v0.0.1(1y ago)301MITCPHP &gt;=8.1

Since Apr 22Pushed 1y agoCompare

[ Source](https://github.com/workbunny/pjson)[ Packagist](https://packagist.org/packages/workbunny/pjson)[ RSS](/packages/workbunny-pjson/feed)WikiDiscussions main Synced today

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

pjson
=====

[](#pjson)

✨ PJson 用于解析 JSON 数据并提供高效的内存管理优化。

依赖
--

[](#依赖)

- PHP 8.1 或更高版本
- Composer 2.0 或更高版本
- PHP 扩展 `ffi` 已启用
- linux 系统
- windows 系统
- mac 系统(自己执沙)

安装
--

[](#安装)

```
composer require workbunny/pjson
```

如何使用
----

[](#如何使用)

[文档](doc/README.MD)

测试对比结果
------

[](#测试对比结果)

> 以此json为例 `https://geo.datav.aliyun.com/areas_v3/bound/100000.json`

php原生

```
// 原生解析
$php_json = json_decode($json_str, true);
// 拿其中一个字段
$type = $php_json['type'];
var_dump($type);
```

```
当前内存：2.35MB
【原生PHP JSON】 (迭代：1 次)
总耗时：0.00311589 秒
每次平均耗时：0.00311589 秒
内存变化：32B

```

pjson

```
// pjson解析
$json = Json::parse($json_str);
$type = Json::get($json, 'type');
var_dump(Json::val($type));
```

```
当前内存：733.2KB
【PJson JSON】 (迭代：1 次)
总耗时：0.00883102 秒
每次平均耗时：0.00883102 秒
内存变化：114.81KB

```

编译json动态库
---------

[](#编译json动态库)

编译适合自己系统的动态库

`build` 文件夹

```
tcc -shared cJSON.c cJSON_Utils.c -o ../lib/Json.dll
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance45

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

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

423d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

jsonphp-ffiphp8jsonparser

### Embed Badge

![Health badge](/badges/workbunny-pjson/health.svg)

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

###  Alternatives

[salsify/json-streaming-parser

A streaming parser for JSON in PHP.

7887.1M21](/packages/salsify-json-streaming-parser)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

806588.3k5](/packages/cerbero-json-parser)[pcrov/jsonreader

JSON Pull Parser

1461.3M6](/packages/pcrov-jsonreader)[bcncommerce/json-stream

A bundle of tools to work with JSON in PHP

682.3M3](/packages/bcncommerce-json-stream)[laktak/hjson

JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.

86245.3k14](/packages/laktak-hjson)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6753.8k](/packages/sbsaga-toon)

PHPackages © 2026

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