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

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

data-values/serialization
=========================

Serializers and deserializers for DataValue implementations

1.2.5(3y ago)3317.6k↑12.7%78GPL-2.0-or-laterPHPPHP &gt;=7.2CI passing

Since Dec 5Pushed 4mo ago12 watchersCompare

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

READMEChangelog (8)Dependencies (4)Versions (13)Used By (8)

DataValues Serialization
========================

[](#datavalues-serialization)

Serializers and deserializers for DataValue implementations.

It is part of the [DataValues set of libraries](https://github.com/DataValues).

[![GitHub Workflow Status](https://camo.githubusercontent.com/aedf59e53abc91dbbcebced43a6dd1cca983cb9750da06c4ca363ca1b86192c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4461746156616c7565732f53657269616c697a6174696f6e2f7068702e796d6c3f6272616e63683d6d6173746572)](https://github.com/DataValues/Serialization/actions?query=workflow%3Aphp)[![Code Coverage](https://camo.githubusercontent.com/aaeb23d56a3b7e4327b385962dc9a90d16fef8e9f7b853a654d890840f3497a1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4461746156616c7565732f53657269616c697a6174696f6e2f6261646765732f636f7665726167652e706e673f733d33653532343433666662663138623938383034666562376330326261343431366633663938366362)](https://scrutinizer-ci.com/g/DataValues/Serialization/)

On [Packagist](https://packagist.org/packages/data-values/geo): [![Latest Stable Version](https://camo.githubusercontent.com/d6adab64d4f20cd9349ffea3381a3b85e469fad8c4efa01b43c3c49127288baf/68747470733a2f2f706f7365722e707567782e6f72672f646174612d76616c7565732f73657269616c697a6174696f6e2f762f737461626c65)](https://packagist.org/packages/data-values/serialization)[![Download count](https://camo.githubusercontent.com/f5bd2b5d6b1173d95042f4499a676456058391adb6e04ead7dfbe177623cf893/68747470733a2f2f706f7365722e707567782e6f72672f646174612d76616c7565732f73657269616c697a6174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/data-values/serialization)

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

[](#installation)

The recommended way to use this library is via [Composer](http://getcomposer.org/).

### Composer

[](#composer)

To add this package as a local, per-project dependency to your project, simply add a dependency on `data-values/serialization` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on version 1.x of this package:

```
{
    "require": {
        "data-values/serialization": "1.*"
    }
}

```

### Manual

[](#manual)

Get the code of this package, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Then take care of autoloading the classes defined in the src directory.

Tests
-----

[](#tests)

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via Github Actions.

Authors
-------

[](#authors)

DataValues Serialization has been written by [Jeroen De Dauw](https://github.com/JeroenDeDauw), as [Wikimedia Germany](https://wikimedia.de) employee for the [Wikidata project](https://wikidata.org/).

Release notes
-------------

[](#release-notes)

### 1.2.5 (2022-10-21)

[](#125-2022-10-21)

- Added a message to a possible deserialization exception.

### 1.2.4 (2021-03-29)

[](#124-2021-03-29)

- Made component installable together with DataValues 3.x
- Raised required PHP version to 7.2

### 1.2.3 (2018-12-01)

[](#123-2018-12-01)

- Made component installable together with DataValues 2.x

### 1.2.2 (2017-10-25)

[](#122-2017-10-25)

- Made component installable together with Serialization 4.x

### 1.2.1 (2017-06-26)

[](#121-2017-06-26)

- Fixed `DataValueDeserializer` not always turning internal `InvalidArgumentException` into `DeserializationException`, as documented.
- Raised required PHP version from 5.3 to 5.5.9.

### 1.2.0 (2017-01-31)

[](#120-2017-01-31)

- Improved error reporting in the `DataValueDeserializer` constructor.
- Added a basic PHPCS rule set, can be run with `composer phpcs`.

### 1.1.0 (2016-05-24)

[](#110-2016-05-24)

- Added support for builder functions to `DataValueDeserializer`

### 1.0.3 (2015-08-05)

[](#103-2015-08-05)

- Removed duplicate catch clause
- Removed `composer update` from the PHPUnit bootstrap file

### 1.0.2 (2014-10-10)

[](#102-2014-10-10)

- Made component installable together with DataValues 1.x

### 1.0.1 (2014-09-09)

[](#101-2014-09-09)

- Handle IllegalValueException in DataValueDeserializer

### 1.0.0 (2014-03-05)

[](#100-2014-03-05)

- Switched usage of the Serialization component from version ~2.1 to version ~3.0.
- Switched from PSR-0 based autoloading to PSR-4 based autoloading
- Made PHPUnit bootstrap file compatible with Windows

### 0.1.0 (2013-12-05)

[](#010-2013-12-05)

Initial release with these features:

- DataValues\\Serializers\\DataValueSerializer - Adapter that fits the toArray method of DataValue objects to the Serializer interface. This allows users to move to using the Serializer interface and remove their exposure to how serialization of DataValues is implemented.
- DataValues\\Deserializers\\DataValueDeserializer - Adapter that fits the newFromArray method of DataValues objects to the Deserializer interface. This allows users to remove the knowledge they have of how deserialization is implemented and break their dependency on DataValueFactory.

Links
-----

[](#links)

- [DataValues Serialization on Packagist](https://packagist.org/packages/data-values/serialization)
- [DataValues Serialization on ScrutinizerCI](https://scrutinizer-ci.com/g/DataValues/Serialization/)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance52

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community33

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~294 days

Recently: every ~485 days

Total

12

Last Release

1305d ago

Major Versions

0.1 → 1.02014-03-05

PHP version history (3 changes)0.1PHP &gt;=5.3.0

1.2.1PHP &gt;=5.5.9

1.2.4PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://avatars.githubusercontent.com/u/22235?v=4)[Stefan Wasilewski](/maintainers/SMW)[@smw](https://github.com/smw)

![](https://www.gravatar.com/avatar/0c1ddc1309ce2f268d42afc35c3065421f8a6d21e4ca25eb338db3a297cdef1b?d=identicon)[DataValues](/maintainers/DataValues)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (64 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (23 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (8 commits)")[![manicki](https://avatars.githubusercontent.com/u/3524114?v=4)](https://github.com/manicki "manicki (8 commits)")[![rosalieper](https://avatars.githubusercontent.com/u/15235452?v=4)](https://github.com/rosalieper "rosalieper (6 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (5 commits)")[![mariushoch](https://avatars.githubusercontent.com/u/2446964?v=4)](https://github.com/mariushoch "mariushoch (4 commits)")[![Ladsgroup](https://avatars.githubusercontent.com/u/5351225?v=4)](https://github.com/Ladsgroup "Ladsgroup (4 commits)")[![lucaswerkmeister](https://avatars.githubusercontent.com/u/2346599?v=4)](https://github.com/lucaswerkmeister "lucaswerkmeister (3 commits)")[![micgro42](https://avatars.githubusercontent.com/u/7372507?v=4)](https://github.com/micgro42 "micgro42 (2 commits)")[![tobijat](https://avatars.githubusercontent.com/u/2997252?v=4)](https://github.com/tobijat "tobijat (2 commits)")[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (1 commits)")[![filbertkm](https://avatars.githubusercontent.com/u/135401?v=4)](https://github.com/filbertkm "filbertkm (1 commits)")

---

Tags

serializationserializerswikidatadatavaluesdeserializers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/data-values-serialization/health.svg)

```
[![Health](https://phpackages.com/badges/data-values-serialization/health.svg)](https://phpackages.com/packages/data-values-serialization)
```

###  Alternatives

[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[jms/serializer

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

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[google/flatbuffers

FlatBuffers for PHP

25.7k134.7k4](/packages/google-flatbuffers)[apache/avro

Apache Avro™ is a data serialization system.

3.2k26.8k3](/packages/apache-avro)[wikibase/data-model-serialization

Serializers and deserializers for the Wikibase DataModel

10196.3k8](/packages/wikibase-data-model-serialization)

PHPackages © 2026

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