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

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

beste/json
==========

A simple JSON helper to decode and encode JSON

1.7.0(8mo ago)4222.7M—2.2%2MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 12Pushed 2w agoCompare

[ Source](https://github.com/beste/json)[ Packagist](https://packagist.org/packages/beste/json)[ GitHub Sponsors](https://github.com/jeromegamez)[ Fund](https://tidelift.com/funding/github/packagist/beste/json)[ RSS](/packages/beste-json/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (2)

JSON
====

[](#json)

[![Current version](https://camo.githubusercontent.com/d9cda79b5761cebffb4f13e808701ed00848b984ae7434634b1201a8440d3036/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62657374652f6a736f6e2e7376673f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/beste/json)[![Supported PHP version](https://camo.githubusercontent.com/da5308b250a317ed8756957d875f8ec090a4d4ef9188fa8582a10d661b79ddaf/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d706870266c6162656c3d504850266d6573736167653d7e372e342e302532302537432537432532307e382e302e302532302537432537432532307e382e312e3026636f6c6f723d373737626234)](https://packagist.org/packages/beste/json)[![Tests](https://github.com/beste/json/workflows/Tests/badge.svg)](https://github.com/beste/json/actions)[![Discord](https://camo.githubusercontent.com/fe8a78d5e2cefe22846d36f43bb41909ef2f1ee8cb7241a21a900a2b1492e0f9/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3830373637393239323537333232303932352e7376673f636f6c6f723d373238396461266c6f676f3d646973636f7264)](https://discord.gg/Yacm7unBsr)[![Sponsor](https://camo.githubusercontent.com/1004a94551d1edaf2a6da4d45ba217b79a46eb18dd7dd2d7825add0a2a8ddc4f/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d476974487562266c6162656c3d53706f6e736f72266d6573736167653d25453225394425413426636f6c6f723d666636396234)](https://github.com/sponsors/jeromegamez)

A simple helper to decode and encode JSON, including from files.

Usage
-----

[](#usage)

```
use Beste\Json;
use UnexpectedValueException;

$object = Json::decode('{"key": "value"}');

$array = Json::decode('{"key": "value"}', $forceArray = true);

$object = Json::decodeFile('/path/to/file.json');

$json = Json::encode($object);

$prettyJson = Json::pretty($object);

// When something goes wring while decoding/encoding,
// an `UnexpectedValueException` is thrown
try {
    Json::decode('{]');
} catch (UnexpectedValueException $e) {
    // Handle error
}
```

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

[](#installation)

```
composer require beste/json
```

Running tests
-------------

[](#running-tests)

```
composer test
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity58

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~163 days

Total

10

Last Release

249d ago

PHP version history (6 changes)1.0.0PHP ~7.4.0 || ~8.0.0 || ~8.1.0

1.1.0PHP ~8.1.0 || ~8.2.0

1.3.0PHP ~8.2.0 || ~8.3.0

1.4.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

1.5.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

1.7.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8685cf532053a084f1eade7b7da00a512c02676e65f1f1bdec73d4978030a47d?d=identicon)[jeromegamez](/maintainers/jeromegamez)

---

Top Contributors

[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (22 commits)")

---

Tags

helperjsonphpjsonhelper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[kigkonsult/icalcreator

iCalcreator is the PHP implementation of rfc2445/rfc5545 and rfc updates, management of calendar information

2462.6M16](/packages/kigkonsult-icalcreator)[chillerlan/php-settings-container

A container class for immutable settings objects. Not a DI container.

3427.3M21](/packages/chillerlan-php-settings-container)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)

PHPackages © 2026

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