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

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

mihai-stancu/serializer
=======================

Customized normalizers and a collection of encoders.

v1.0.4(9y ago)750.4k1MITPHPPHP &gt;=5.4CI failing

Since Dec 2Pushed 8y ago2 watchersCompare

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

READMEChangelogDependencies (16)Versions (7)Used By (1)

Serializer
==========

[](#serializer)

Contents
--------

[](#contents)

A recursive normalizer that uses symfony/property-info to deduce data types of elements in an object graph.

A type hinted normalizer that retains type information about the object graph being normalized.

A collection of (symfony compliant) encoders for the following formats:

- [Bencode](http://en.wikipedia.org/wiki/Bencode) as a pure PHP implementation provided by [rych/bencode](http://github.com/rchouinard/bencode).
- [BSON](http://en.wikipedia.org/wiki/BSON) as a PHP extension provided by the `mongo` extension.
- [CBOR](http://cbor.io/) as a pure PHP implementation provided by [2tvenom/cborencode](http://github.com/2tvenom/cborencode).
- [Export](http://php.net/manual/ro/function.var-export.php) as a PHP core functionality.
- [Form](http://php.net/manual/en/function.http-build-query.php) as a PHP core functionality.
- [IGBinary](http://github.com/igbinary/igbinary) as a PHP extension provided by the `igbinary` extension -- as a drop-in replacement for `PHP Serialize`.
- [Ini](http://github.com/zendframework/zend-config) PHP implementation provided by [zendframework/zend-config](http://github.com/zendframework/zend-config).
- [MsgPack](http://msgpack.org/) as a PHP extension provided by the `msgpack` extension.
- [Rison](http://github.com/Nanonid/rison) as a pure PHP implementation provided by [deceze/Kunststube-Rison](http://github.com/deceze/Kunststube-Rison).
- [`//Sereal`](http://github.com/Sereal/Sereal) as a pure PHP implementation provided by [tobyink/sereal](http://github.com/tobyink/php-sereal).
- [Serialize](http://php.net/manual/ro/function.serialize.php) as a PHP core functionality.
- [`//Smile`](http://en.wikipedia.org/wiki/Smile_(data_interchange_format)) as a PHP extension provided by the `libsmile` extension.
- [Tnetstring](http://en.wikipedia.org/wiki/Netstring) as a pure PHP implementation provided by [phuedx/tnetstring](http://github.com/phuedx/tnetstring).
- [UBJSON](http://ubjson.org/) as a pure PHP implementation provided by [dizews/php-ubjson](http://github.com/dizews/php-ubjson).
- [YAML](http://en.wikipedia.org/wiki/YAML) as a PHP extension provided by the `yaml` extension or a pure PHP implementation provided by [symfony/yaml](http://github.com/symfony/yaml).

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

[](#installation)

Choose one ore more encoding formats from the suggestions in `composer.json`. If the chosen format is described below as PHP extension you will have to install said extension. If it is a pure PHP implementation you will be able to require it via composer.

```
composer require mihai-stancu/serializer
composer require your-chosen/encoder-package
```

```
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new MS\SerializerBundle\MSSerializerBundle(),
    // ...
);
```

Usage
-----

[](#usage)

After having installed the bundle and at least one of the suggested encoding formats, that encoding format will be registered as a serialization format for the [symfony/serializer](http://symfony.com/doc/current/components/serializer.html).

```
$encoderName = array_rand(
    array(
        'bencode',
        'bson',
        'cbor',
        'export',
        'form',
        'igbinary',
        'ini',
        'msgpack',
        'rison',
        //'sereal',
        'serial',
        //'smile',
        'tnetstring',
        'ubjson',
        'yaml',
    )
);

$serializer = $container->get('serializer');
$string = $serializer->serialize($data, $encoderName);
$data = $serializer->unserialize($data, $class, $encoderName);
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~134 days

Total

5

Last Release

3329d ago

PHP version history (2 changes)v1.0.0PHP ^5.3

v1.0.1PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/60ee24787511ba533b00897d359773c394bc11987dc75a6b15a75924a35ba61d?d=identicon)[mihai-stancu](/maintainers/mihai-stancu)

---

Top Contributors

[![mihai-stancu](https://avatars.githubusercontent.com/u/1294142?v=4)](https://github.com/mihai-stancu "mihai-stancu (1 commits)")

---

Tags

normalizeserializeencodeMarshal

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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