PHPackages                             gnugat/marshaller - 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. gnugat/marshaller

Abandoned → [symfony/serializer](/?search=symfony%2Fserializer)Library[Parsing &amp; Serialization](/categories/parsing)

gnugat/marshaller
=================

A PHP library that converts from one format to another

v2.0.0(10y ago)63591MITPHPPHP &gt;=5.3.3

Since May 18Pushed 10y ago2 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (4)Used By (1)

Marshaller [![SensioLabsInsight](https://camo.githubusercontent.com/6f44ce5961aa90d377153f3de759d0290a17d1113a337f90fae1d5f8215cbbca/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65336631623432632d653739362d343063382d626662312d3239396137393938336432652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/e3f1b42c-e796-40c8-bfb1-299a79983d2e) [![Travis CI](https://camo.githubusercontent.com/1994414ea1e0acac6d1bfc9275ca5b47a2ec5537f4444154b6c6a40a491105f6/68747470733a2f2f7472617669732d63692e6f72672f676e756761742f6d61727368616c6c65722e706e67)](https://travis-ci.org/gnugat/marshaller)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#marshaller--)

A PHP library that converts from one format to another.

Marshaller doesn't try to guess how to convert the given input, instead it relies on `MarshallerStrategies` implemented by the developers: it gives us full control on the output formats.

To automatically convert an input into specific formats (like XML, JSON or YAML), it might be better to use other tools (e.g. [JMS Serializer](http://jmsyst.com/libs/serializer)).

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

[](#installation)

Marshaller can be installed using [Composer](http://getcomposer.org/):

```
composer require "gnugat/marshaller:~2.0"

```

Simple conversion
-----------------

[](#simple-conversion)

Let's take the following object:

```
