Speaker Deck

Data (De)Serialization 101

by Hugo Hamon

Published September 3, 2015 in Programming

PHP has built-in support for serializing and deserializing data structures such as arrays or objects. However, serializing complex data structures to strings with PHP doesn’t really work well. Nowadays, modern web applications need to provide REST APIs to expose their data as XML or JSON. Thanks to the Symfony Serializer standalone component, serializing and deserializing complex graphs of objects to XML or JSON is much easier. This talk will demonstrate how to leverage the Symfony Serializer component to (de)serialize data. You will also learn how to extend the Serializer to customize how objects graphs are (de)serialized. Finally, we will look at the JMS Serializer standalone library that provides a much wider features set such as serialization metadata configuration thanks to annotations, YAML or XML formats.