A PHP library for serializing and deserializing data of any complexity, supporting JSON and XML formats.
jms/serializer is a PHP library for converting complex PHP data structures into serialized formats like JSON and XML, and deserializing them back. It handles challenging scenarios such as circular references and offers extensive customization to adapt outputs to specific application needs.
PHP developers building applications that require robust serialization and deserialization of complex data, especially those integrating with APIs, Doctrine ORM, or needing versioning support.
Developers choose jms/serializer for its graceful handling of circular references, built-in support for PHP types like dates, and flexible configuration via XML, YAML, or annotations, making it ideal for evolving APIs and complex data scenarios.
Library for (de-)serializing data of any complexity (supports JSON, and XML)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Gracefully manages circular references and implements sophisticated exclusion strategies, preventing infinite loops in object graphs during serialization.
Natively supports PHP types like dates and intervals, ensuring accurate serialization without manual conversion for common data types.
Seamlessly integrates with Doctrine ORM, making it easy to serialize database entities in PHP applications without extra boilerplate.
Enables versioning for evolving data structures, essential for maintaining backward compatibility in long-term API projects.
Configurable via XML, YAML, or annotations, offering multiple ways to define serialization rules to fit different development workflows.
Upgrading between major versions (e.g., from 2.x to 3.x) requires significant code changes, as noted in the UPGRADING document, which can be time-consuming.
The flexibility comes with overhead; setting up serialization rules via annotations or configuration files can be verbose and complex for simple use cases.
Advanced features like circular reference handling and annotation parsing may introduce latency compared to simpler, more lightweight serialization libraries.