PHPackages                             egeloen/serializer - 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. egeloen/serializer

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

egeloen/serializer
==================

Serializer for PHP 5.6+ supporting JSON, XML, YAML &amp; CSV

1.0.0(9y ago)28578.3k↓29.3%21[6 issues](https://github.com/egeloen/ivory-serializer/issues)[2 PRs](https://github.com/egeloen/ivory-serializer/pulls)3MITPHPPHP ^5.6|^7.0

Since Feb 27Pushed 6y ago7 watchersCompare

[ Source](https://github.com/egeloen/ivory-serializer)[ Packagist](https://packagist.org/packages/egeloen/serializer)[ RSS](/packages/egeloen-serializer/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (15)Versions (3)Used By (3)

README
======

[](#readme)

[![Travis Build Status](https://camo.githubusercontent.com/85f73448baafee00e769bb8c55913c684e155286437684bfa869c2757e7c1b1c/68747470733a2f2f7472617669732d63692e6f72672f6567656c6f656e2f69766f72792d73657269616c697a65722e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/egeloen/ivory-serializer)[![AppVeyor Build status](https://camo.githubusercontent.com/7809074ab7cf0ab0928a1b7232ea1a33ef53362e911152d955c6cf3e00bba8f9/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f71326874643573636f7473766a686f782f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/egeloen/ivory-serializer/branch/master)[![Code Coverage](https://camo.githubusercontent.com/d3f559f36f43329d89a8aff414db18c55e9413d8285b2ec81aa603ec6c4b204d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6567656c6f656e2f69766f72792d73657269616c697a65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/egeloen/ivory-serializer/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e2956d9bae7e28dec25eea7b8ce7bb2c2b536acf1cd136d43a52c7e1ed9b9150/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6567656c6f656e2f69766f72792d73657269616c697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/egeloen/ivory-serializer/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/4e34bfdeb99ac1973b103e537c5fb658cf5f02816eac0a69a8d35a6faf69018f/687474703a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6567656c6f656e3a73657269616c697a65722f62616467652e737667)](http://www.versioneye.com/php/egeloen:serializer)

[![Latest Stable Version](https://camo.githubusercontent.com/f4633fe4a5b23ea662ba2a94d4308d2ecce1ed5fc303805768648b4848588b62/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f73657269616c697a65722f762f737461626c652e737667)](https://packagist.org/packages/egeloen/serializer)[![Latest Unstable Version](https://camo.githubusercontent.com/21a0c39282a6d20a7c273ce568b9c193aee3773cf7261f354282824b50616a77/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f73657269616c697a65722f762f756e737461626c652e737667)](https://packagist.org/packages/egeloen/serializer)[![Total Downloads](https://camo.githubusercontent.com/3ea1d8178f8554610e9104bd17251a5af8ce40a5b13edc18c32c51229f311bf6/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f73657269616c697a65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/egeloen/serializer)[![License](https://camo.githubusercontent.com/f7b42467667db4f450b3defcb93b55d0513e7886bfd37beddd087174778a0a98/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f73657269616c697a65722f6c6963656e73652e737667)](https://packagist.org/packages/egeloen/serializer)

Overview
--------

[](#overview)

The Ivory Serializer is a PHP 5.6+ library allowing you to (de)-serialize complex data using the visitor pattern recursively on each node of the graph. It supports the CSV, JSON, XML and YAML formats. It also supports features such as exclusion strategies (groups, max depth, circular reference, version, ...), naming strategies (camel case, snake case, studly caps), automatic/explicit mapping (reflection, annotation, XML, YAML, JSON) and many others...

```
use Ivory\Serializer\Format;
use Ivory\Serializer\Serializer;

$stdClass = new \stdClass();
$stdClass->foo = true;
$stdClass->bar = ['foo', [123, 432.1]];

$serializer = new Serializer();

echo $serializer->serialize($stdClass, Format::JSON);
// {"foo": true,"bar": ["foo", [123, 432.1]]}

$deserialize = $serializer->deserialize($json, \stdClass::class, Format::JSON);
// $deserialize == $stdClass
```

Documentation
-------------

[](#documentation)

- [Installation](/doc/installation.md)
- [Usage](/doc/usage.md)
- [Mapping](/doc/mapping.md)
- [Type](/doc/type.md)
- [Event](/doc/event.md)
- [Visitor](/doc/visitor.md)
- [Context](/doc/context.md)
    - [Exclusion strategies](/doc/context.md#exclusion-strategies)
    - [Naming strategies](/doc/context.md#naming-strategies)

Testing
-------

[](#testing)

The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**. To execute the test suite, check the travis [configuration](/.travis.yml).

Contribute
----------

[](#contribute)

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the [CONTRIBUTING](/CONTRIBUTING.md) file which will explain you how to set up the project.

License
-------

[](#license)

The Ivory Serializer is under the MIT license. For the full copyright and license information, please read the [LICENSE](/LICENSE) file that was distributed with this source code.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99% 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

3413d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/808f1df1f6ccd749b9c985f3b4a8753788e9bf74e7cead639fcf49cd2a714fd0?d=identicon)[egeloen](/maintainers/egeloen)

---

Top Contributors

[![GeLoLabs](https://avatars.githubusercontent.com/u/149005863?v=4)](https://github.com/GeLoLabs "GeLoLabs (101 commits)")[![AlexandrePavy](https://avatars.githubusercontent.com/u/6603411?v=4)](https://github.com/AlexandrePavy "AlexandrePavy (1 commits)")

---

Tags

serializer

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/egeloen-serializer/health.svg)

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

###  Alternatives

[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[doctrine/orm

Object-Relational-Mapper for PHP

10.2k300.5M7.5k](/packages/doctrine-orm)[jms/serializer

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

2.3k141.9M929](/packages/jms-serializer)[masterminds/html5

An HTML5 parser and serializer.

1.8k269.7M322](/packages/masterminds-html5)[symfony/rate-limiter

Provides a Token Bucket implementation to rate limit input and output in your application

27054.3M290](/packages/symfony-rate-limiter)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)

PHPackages © 2026

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