PHPackages                             johyunchol/php-gson2 - 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. johyunchol/php-gson2

ActiveLibrary

johyunchol/php-gson2
====================

PHP GSON equivalent - simple entity mapper. JSON to object and object to JSON. from archangeldesign/php-gson

0.2.1(5y ago)022BSD-3-ClausePHPPHP &gt;=7.1

Since May 10Pushed 4y agoCompare

[ Source](https://github.com/johyunchol/php-gson2)[ Packagist](https://packagist.org/packages/johyunchol/php-gson2)[ Docs](https://archangeldesign.github.io/php-gson/)[ RSS](/packages/johyunchol-php-gson2/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

php-gson
========

[](#php-gson)

[![Build Status](https://camo.githubusercontent.com/d6648f667aaa201ea71c9caedd1df16608dec17f75f26976adcb57f12743cccd/68747470733a2f2f7472617669732d63692e636f6d2f41726368616e67656c44657369676e2f7068702d67736f6e2e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/d6648f667aaa201ea71c9caedd1df16608dec17f75f26976adcb57f12743cccd/68747470733a2f2f7472617669732d63692e636f6d2f41726368616e67656c44657369676e2f7068702d67736f6e2e7376673f6272616e63683d6d6173746572)[![Coverage Status](https://camo.githubusercontent.com/7d97c00e9be07f42e00d7e89de8117b15bd145243cd7e13ea4979bb13e419aa9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f41726368616e67656c44657369676e2f7068702d67736f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ArchangelDesign/php-gson?branch=master)

Zero dependency simple PHP entity mapper. JSON String to Objcet and Object to JSON String.

**Installation**

```
composer require johyunchol/php-gson2

```

or download and include autoload.php

```
include 'php-gson/src/PHPGson2/autoload.php';

```

**Usage**

Without instance. Object will be created using given class name.

```
$complexObject = null;
$success = \PHPGson2\Gson::fromJson(
    $complexObject,
    '{"age":35, "hydratorTestObject":{"username":"raff"}}',
    \PHPGson2\Extractor::EXTRACTION_MODE_METHOD,
    ComplexHydrationObject::class
);

```

With manual instantiation. Sub-objects will be created automatically in both cases.

```
$complexObject = new ComplexHydrationObject();
$success = \PHPGson2\Gson::fromJson(
    $complexObject,
    '{"age":35, "hydratorTestObject":{"username":"raff"}}'
);

```

```
$object = new MainObject();
$jsonString = Gson::toJson($object);

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.3% 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 ~516 days

Total

3

Last Release

1887d ago

PHP version history (2 changes)0.1.0-rc1PHP &gt;=5.6

0.2PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/413614aed7a367665fe220e7fffed244991f56c75fc4f86d8b0740683e370f9a?d=identicon)[JoHyunChol](/maintainers/JoHyunChol)

---

Top Contributors

[![ArchangelDesign](https://avatars.githubusercontent.com/u/8267447?v=4)](https://github.com/ArchangelDesign "ArchangelDesign (36 commits)")[![johyunchol](https://avatars.githubusercontent.com/u/3314683?v=4)](https://github.com/johyunchol "johyunchol (1 commits)")

---

Tags

entitymappergson

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/johyunchol-php-gson2/health.svg)

```
[![Health](https://phpackages.com/badges/johyunchol-php-gson2/health.svg)](https://phpackages.com/packages/johyunchol-php-gson2)
```

###  Alternatives

[doctrine/persistence

The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.

4.1k286.5M760](/packages/doctrine-persistence)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M300](/packages/doctrine-mongodb-odm)[cuyz/valinor

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

1.5k9.2M108](/packages/cuyz-valinor)[vlucas/spot2

Simple DataMapper built on top of Doctrine DBAL

605392.8k7](/packages/vlucas-spot2)[analogue/orm

An intuitive Data Mapper ORM for PHP and Laravel

63547.1k3](/packages/analogue-orm)[cakephp/datasource

Provides connection managing and traits for Entities and Queries that can be reused for different datastores

4624.6M11](/packages/cakephp-datasource)

PHPackages © 2026

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