schmittjoh / serializer

Library for (de-)serializing data of any complexity (supports JSON, and XML)
http://jmsyst.com/libs/serializer
MIT License
2.32k stars 589 forks source link

feat(handler): Create JsonSerializable handler #1486

Open scyzoryck opened 1 year ago

scyzoryck commented 1 year ago
Q A
Bug fix? no
New feature? yes
Doc updated not yet
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT

Why?

PHP provides nice interface to serialize data to Json, that is also fast. It works only in the serialization direction, there is no way to handle deserialization with it. In our benchmarks, after adding it to Author class we gained 15% faster serialization.

TODOs:

goetas commented 1 year ago

This is a very nice addition. I think that it should be an opt in feature as it might be seen as a BC break if suddenly we start using it to decide what json serializeation should look