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

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

kapitanluffy/json-object
========================

Treat JSON as objects in PHP

10PHP

Since Apr 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kapitanluffy/json-object)[ Packagist](https://packagist.org/packages/kapitanluffy/json-object)[ RSS](/packages/kapitanluffy-json-object/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP JSON Objects
================

[](#php-json-objects)

Treat JSON as objects in PHP instead of strings.

##### Install

[](#install)

```
composer require kapitanluffy/json-object

```

##### Usage

[](#usage)

```
$json = new JsonObject($data);

// encoding to json
$encoded = json_encode($json);
$encoded = $json->encode();
$encoded = (string) $json;

// decoding to data
$decoded = JsonObject::decode($json);

// set options
$json->options(JSON_NUMERIC_CHECK)->encode();

// throw a JsonException on error
$json->withErrors(true)->encode();

// check if the current instance throws an error
$json->isErrorThrown();

// returns the last occurred JsonException
JsonObject::getError();
```

Note that methods `options` and `withErrors` returns a new instance rather than modifying the current JsonObject instance.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/94708d8e5552d7869dca34196b0fd8785584117b7f3d534abd849ab574da70ab?d=identicon)[kapitanluffy](/maintainers/kapitanluffy)

---

Top Contributors

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

---

Tags

jsonphp

### Embed Badge

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

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

PHPackages © 2026

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