Re: [RFC] New custom object serialization mechanism
| From: | Claude Pache | Date: | Mon, 28 Jan 2019 13:27:21 +0000 |
| Subject: | Re: [RFC] New custom object serialization mechanism | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103864@lists.php.net to get a copy of this message | ||
> Le 28 janv. 2019 à 08:58, Marco Pivetta <ocramius@gmail.com> a écrit :
>
>>
>> Here, both aspects are not desired: we don't want ppl to type-hint for
>> e.g. Serializable - and too bad it exists because I've already seen ppl
>> think: "hey, I'll type-hint or extend it to express I want a serializable
>> thing".
>
>
> That's actually a very correct thing to do: by declaring that something is
>
Serializable, you are expressing your intent to anybody
> inspecting the
> structure of the object.
>
This interface (as well as JsonSerializable) is incorrectly named. If I believe the
manual, it is an ”interface for customized serializing”; therefore it should have been called
CustomizedSerialization or something like that.
If we use a new interface, at the very least, let its name match its function (or its function match
its name).
—Claude