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

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

arokettu/json
=============

ext-json wrapper with sane defaults

2.1.0(2y ago)07.3k↓30.6%2MITPHPPHP ^8.0

Since Jul 27Pushed 8mo agoCompare

[ Source](https://github.com/arokettu/php-json)[ Packagist](https://packagist.org/packages/arokettu/json)[ Docs](https://sandfox.dev/php/json.html)[ RSS](/packages/arokettu-json/feed)WikiDiscussions master Synced 1mo ago

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

JSON
====

[](#json)

[![Packagist](https://camo.githubusercontent.com/a3ea6218badc6a2ab74b4b11daf49de21394f28ca5921b2e0d21916ccd3c8f01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61726f6b657474752f6a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arokettu/json)[![Packagist](https://camo.githubusercontent.com/c8188e1dc087de4c045e09d639ae1e1642c29633c7321b02360c3a7eecbb84b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61726f6b657474752f6a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)[![Gitlab pipeline status](https://camo.githubusercontent.com/482245509fc01ad44fc4a1f1bcf84be005295aa37978490067a6effc71cdab88/68747470733a2f2f696d672e736869656c64732e696f2f6769746c61622f706970656c696e652f73616e64666f782f7068702d6a736f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://gitlab.com/sandfox/php-json/-/pipelines)[![Codecov](https://camo.githubusercontent.com/c45d41ae90a5eab95a32589be9feb7be411cb01fc2aa4f5f6f69ac0a58c29eb0/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f676c2f73616e64666f782f7068702d6a736f6e3f7374796c653d666c61742d737175617265)](https://codecov.io/gl/sandfox/php-json/)

A wrapper for the standard ext-json with sane defaults

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

[](#installation)

```
composer require 'arokettu/json'
```

Features
--------

[](#features)

### Decoding wrapper

[](#decoding-wrapper)

Decoding wrapper is the main purpose of the library. It's killer feature is that JSON objects become instances of ArrayObject instead of stdClass. This both keeps array/object types of the original and allows to work with all data as with arrays.

```
