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

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

xoubaman/json
=============

A simple JSON wrapper

0.1(6y ago)05.0kMITPHPPHP ^7.3CI failing

Since May 16Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

JSON
====

[](#json)

A simple JSON wrapper class.

Features:

- Encode arrays|objects
- Decode JSON strings
- Validate JSON strings
- Throw exceptions on failure

Nothing else. As said, it is simple.

Usage
-----

[](#usage)

- `Json::encode($input): string`: encodes into JSON
- `Json::decode(string $json): array`: decodes a JSON into an array
- `Json::fromString(string $json)`: new Json instance
- `$json->isValid(): bool`: whether the provided JSON is valid or not
- `$json->input(): string`: the input used for instantiation
- `$json->error(): string`: the error description, empty if no error
- `$json->errorCode(): int`: the error code, JSON\_ERROR\_NONE if no error
- `$json->asArray(): array`: the input decoded, throws a `RuntimeException` if not a valid JSON

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

2193d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1311258?v=4)[Carlos Gándara](/maintainers/Xoubaman)[@xoubaman](https://github.com/xoubaman)

---

Top Contributors

[![xoubaman](https://avatars.githubusercontent.com/u/1311258?v=4)](https://github.com/xoubaman "xoubaman (6 commits)")

---

Tags

json

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M612](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15267.7M16](/packages/clue-ndjson-react)

PHPackages © 2026

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