PHPackages                             jdwx/json-php - 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. jdwx/json-php

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

jdwx/json-php
=============

JSON helper functions for PHP.

v1.1.4(3mo ago)03.6k5MITPHP

Since Nov 19Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/jdwx/json-php)[ Packagist](https://packagist.org/packages/jdwx/json-php)[ RSS](/packages/jdwx-json-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (5)

json-php
========

[](#json-php)

JSON helper functions for PHP.

Installation
------------

[](#installation)

You can require it directly with Composer:

```
composer require jdwx/json-php
```

Or download the source from GitHub:

Requirements
------------

[](#requirements)

This module requires PHP 8.3 or later and the JSON extension.

Usage
-----

[](#usage)

Here is a basic usage example:

```
use JDWX\Json\Json;

$data = Json::decode( '{"a":1,"b":2}' );
var_dump( $data );

$json = Json::encode( $data );
echo $json, "\n";

$json = Json::encodePretty( $data );
echo $json, "\n";
```

This module also supports streaming JSON decoding, such as reading from a JsonLines file:

```
use JDWX\Json\JsonLines;

$stream = fopen( 'file.jsonl', 'r' );
while( $data = JsonLines::decodeFile( $stream ) ) {
    var_dump( $data );
}
```

This module also includes:

- lower-level interfaces for streaming JSON decoding that allow (among other things) reading the elements of a JSON list individually without loading the whole list into memory
- a feature-complete JSON lexer that breaks input into discrete JSON elements

Most of the streaming functionality is designed to support cases where JSON input might be problematically large or when it is coming from a potentially endless source, such as a network connection.

There is extensive test coverage for this module, which provides additional examples of usage.

Stability
---------

[](#stability)

This module is considered stable and is extensively used in production code.

History
-------

[](#history)

This module was refactored out of a larger codebase in November 2024.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity43

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

Recently: every ~95 days

Total

7

Last Release

103d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jdwx-json-php/health.svg)

```
[![Health](https://phpackages.com/badges/jdwx-json-php/health.svg)](https://phpackages.com/packages/jdwx-json-php)
```

###  Alternatives

[oomphinc/drupal-scaffold

A Drupal scaffold project

192.6k](/packages/oomphinc-drupal-scaffold)

PHPackages © 2026

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