PHPackages                             estvoyage/serialization - 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. estvoyage/serialization

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

estvoyage/serialization
=======================

An east-oriented serialization interface

17PHP

Since Sep 22Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

*estvoyage\\serialization* [![Build Status](https://camo.githubusercontent.com/b6f9404ea5ef98e16d646c93e099578eeace5ae936f2487246581202137ed6d7/68747470733a2f2f6170692e7472617669732d63692e6f72672f657374766f796167652f73657269616c697a6174696f6e2e737667)](https://travis-ci.org/estvoyage/serialization) [![Coverage Status](https://camo.githubusercontent.com/8319f38b5d8a55d1585752d9d2ab3a3390b902484513c192ac7afcaef145daba/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f657374766f796167652f73657269616c697a6174696f6e2f62616467652e737667)](https://coveralls.io/r/estvoyage/serialization)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#estvoyageserialization--)

An east-oriented serialization interface
----------------------------------------

[](#an-east-oriented-serialization-interface)

**serialization** is a [PHP](http://www.php.net) library that allows you to implement a [serialization](http://en.wikipedia.org/wiki/Serialization) protocol in any class.
Traditionaly, if you want serialize an instance as JSON, you implements the [`jsonSerializable`](http://php.net/jsonserializable) interface in its class.
Moreover, if several classes should support JSON serialization, you should implements this interface in each of them.
And if you want to use an another serialization format, e.g. XML, you should implement a new method in each class. With **serialization**, you can define a unique method in each class to handle any serialization format.

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

[](#installation)

Minimal PHP version to use **serialization** is 5.6.
The recommended way to install Negotiation is through [Composer](http://getcomposer.org/), just add this in your `composer.json` and execute `php composer.phar install`:

```
{
	"require": {
		"estvoyage/serialization": "@dev",
		"estvoyage/object": "@dev",
		"estvoyage/value": "@dev"
	}
}
```

Usage
-----

[](#usage)

In a nutshell:

```
