Registry / serialization / symfony-serializer

symfony-serializer

JSON →
library8.1.0phppackagistunverified

Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.

composer require symfony/serializer
INSTALL
IMPORT
SIG · SYMFONY-SERIALIZER
S
symfony-serializer
serializationphpv8.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Serializer
use Symfony\Component\Serializer\Serializer;

Serialize an object to JSON

use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; $serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]); $data = $serializer->serialize($object, 'json');
Debug
Known issues
breakingRequires PHP 8.2 or higher for version 8.1
fix
Upgrade PHP to 8.2+ or use an older version of the package
affects: >=8.1
Upgrade
Version history
8.1.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
symfony-serializer — pip install symfony-serializer · libregistry