PHPackages                             stratadox/deserializer - 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. stratadox/deserializer

ActiveLibrary

stratadox/deserializer
======================

v1.0.0(3y ago)0173[1 PRs](https://github.com/Stratadox/Deserializer/pulls)2MITPHPPHP &gt;=8.0

Since Aug 13Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (10)Versions (7)Used By (2)

Deserializer
============

[](#deserializer)

[![Build Status](https://camo.githubusercontent.com/74dfd9722c3bc30b86c88225510bcef6a5100128b9e1ef23b8402e719e8ba761/68747470733a2f2f7472617669732d63692e6f72672f537472617461646f782f446573657269616c697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Stratadox/Deserializer)[![Coverage Status](https://camo.githubusercontent.com/91df08bf474659c0e84b52a092ebd0e91e958f601aae4c20d6fa1fd2f57179d5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f537472617461646f782f446573657269616c697a65722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Stratadox/Deserializer?branch=master)[![Infection Minimum](https://camo.githubusercontent.com/416cfd74a77aee9719fd9a0c0b5f9dd6970485b055c1e9a4cd01ce05e08a1754/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d73692d3130302d627269676874677265656e2e737667)](https://travis-ci.org/Stratadox/Deserializer)[![PhpStan Level](https://camo.githubusercontent.com/e58915c82e085736fd9da556ddfcae809f3d34c62575773ffeae09481619c66a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d372d627269676874677265656e2e737667)](https://travis-ci.org/Stratadox/Deserializer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8819a855fa1023180014b0d951a2327ec30dc7ddf33b265639f9aca21a38edfd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f537472617461646f782f446573657269616c697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Stratadox/Deserializer/?branch=master)[![Maintainability](https://camo.githubusercontent.com/bfecdfb76be08a1e24cd1e20f2d7f6c1ec38505bb34dfc8f2414a2107b36364d/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33376232313166653331373932613131343134302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Stratadox/Deserializer/maintainability)[![Latest Stable Version](https://camo.githubusercontent.com/5dee2163140b94716f2747d152d784e13fcac6d497f5bd5a6256c62983823f67/68747470733a2f2f706f7365722e707567782e6f72672f737472617461646f782f646573657269616c697a65722f762f737461626c65)](https://packagist.org/packages/stratadox/deserializer)[![License](https://camo.githubusercontent.com/a75e17cd953dce439db62bea2003281c0d329672789cd079f0639766bcbfb124/68747470733a2f2f706f7365722e707567782e6f72672f737472617461646f782f646573657269616c697a65722f6c6963656e7365)](https://packagist.org/packages/stratadox/deserializer)

[![Implements](https://camo.githubusercontent.com/22310323fd7a1ed5523bcaf5b168314c35a6ce539c298534ea228e4a5f723489/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696e66657266616365732d6769746875622d626c75652e737667)](https://github.com/Stratadox/DeserializerContracts)[![Latest Stable Version](https://camo.githubusercontent.com/b8c05ba9d8bb1fbad7a7604755ace3cb31939b14932643dcf472395219f29384/68747470733a2f2f706f7365722e707567782e6f72672f737472617461646f782f646573657269616c697a65722d636f6e7472616374732f762f737461626c65)](https://packagist.org/packages/stratadox/deserializer-contracts)[![License](https://camo.githubusercontent.com/2e9c0459ba8bea51686605ea69b24769ab0469f29eb5ed0b7a7af9379eb8ceae/68747470733a2f2f706f7365722e707567782e6f72672f737472617461646f782f646573657269616c697a65722d636f6e7472616374732f6c6963656e7365)](https://packagist.org/packages/stratadox/deserializer-contracts)

Transforms serialized data into objects.

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

[](#installation)

Install with `composer require stratadox/deserializer`

What is this?
-------------

[](#what-is-this)

An object that [`Deserializes`](https://github.com/Stratadox/DeserializerContracts)can convert `serialized` data into objects.

The `serialized` input data is expected to have the form of an array, either numeric or associative. This way, one can easily convert both the results of sql queries and decoded json, as well as session data and other sources.

How to use this?
----------------

[](#how-to-use-this)

To write the contents of an associative array to an object, one can use:

```
