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

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

sobernt/json-object
===================

1.0.7(6y ago)0378MITPHPPHP ^7.2

Since Nov 29Pushed 6y ago1 watchersCompare

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

READMEChangelog (7)DependenciesVersions (7)Used By (0)

**Install**

install this package via composer:

`composer require sobernt/json-object`

**Usage**

init object with minimal params:

```
$obj = new sobernt\JsonObject\JsonObject("{
    \"testkey\":\"testval\",
    \"testarray\":[
        \"testsimplearrayval1\",
        \"testsimplearrayval2\"
    ],
    \"testcompositearray\":[
        \"testcompositearrayval1\",
        {
             \"testcompositearray2key\": \"testcompositearray2value\"
        }
    ],
     \"testobject\":{
             \"testobjectkey\": \"testobjectval\",
             \"testobjectintkey\": \"1\"
    }
}");

```

full constructor:

`__construct($json,$max_depth=255)`

set `$max_depth = 500` for reconfigure object max recursion level = 500

throws `JsonException` if json can't be parse

you can use this as default object $obj-&gt;testobject

this example return array:

```
$obj->testarray

```

this example returns object:

```
$obj->testcompositearray[1]

```

throws `InvalidArgumentException` if you call object not founded in json

you can set our prop \[string or JsonObject\]:

```
$obj->prop="testprop"

```

this example return value from tree:

```
$obj->filter("testcompositearray[1].testcompositearray2key")

```

you can set your formatter for primitive objects:

```
 $this->setFormatter(function(string $data,string $name=null)
    {
    ..
    return $data;
    }
)

```

formatter necessarily has 2 import params:data and name. it's throw `InvalidArgumentException` if input is not callable.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

5

Last Release

2344d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/737d13b447b58ec061d0570e59ec0d8ab0fe6747c2dd63d25015da763424f26f?d=identicon)[sobernt](/maintainers/sobernt)

---

Top Contributors

[![sobernt](https://avatars.githubusercontent.com/u/22237210?v=4)](https://github.com/sobernt "sobernt (7 commits)")

### Embed Badge

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

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

###  Alternatives

[jasonlewis/resource-watcher

Simple PHP resource watcher library.

221145.8k14](/packages/jasonlewis-resource-watcher)

PHPackages © 2026

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