Re: [RFC] New custom object serialization mechanism
| From: | Nicolas Grekas | Date: | Thu, 24 Jan 2019 14:02:05 +0000 |
| Subject: | Re: [RFC] New custom object serialization mechanism | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103826@lists.php.net to get a copy of this message | ||
Thank you Nikita,
the RFC looks solid to me. Using magic methods makes perfect sense to allow
a smooth migration path.
We could enforce that if one of __serialize() or __unserialize() is
> defined, both have to be defined, to avoid running into such cases.
That would make sense a lot of sense to me.
> Maybe one could use
__normalize() and
> __denormalize() [...]
>
I'd like that "serialization" appears in some form in the name
>
An idea: __pre_serialize / __post_unserialize
But __serialize/__unserialize are good to me.
Nicolas