Re: [RFC] Phasing out Serializable
| From: | Nikita Popov | Date: | Tue, 23 Mar 2021 17:19:22 +0000 |
| Subject: | Re: [RFC] Phasing out Serializable | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-113726@lists.php.net to get a copy of this message | ||
On Tue, Mar 23, 2021 at 5:01 PM Nicolas Grekas <nicolas.grekas+php@gmail.com>
wrote:
> Hello Nikita,
>
>
> Picking up a loose thread:
>> https://wiki.php.net/rfc/custom_object_serialization
>> introduced a
>> replacement for Serializable in PHP 7.4, so it's time to think about
>> deprecating and removing the old mechanism:
>>
>> https://wiki.php.net/rfc/phase_out_serializable
>>
>> This RFC follows a rather conversative approach. In PHP 8.1 there will be
>> a
>> deprecation warning if Serializable is implemented without also
>> implementing __serialize() and __unserialize(). In PHP 9.0, support for
>> Serializable is dropped internally, and only the interface retained. In
>> PHP
>> 10.0 the interface is dropped as well.
>>
>
>
> Reading the comments in this thread, the three-step approach is surprising
> to some.
> What about deprecating in 8.1 and removing in 9.0 instead?
> The stub Serializable interface can be provided in userland via a
> polyfill, if anyone really needs a smoother transition plan.
>
> I'd really like to see this deprecation in 8.1, to stop ppl from writing
> new implementations of Serializable asap.
>
I've updated the RFC to follow this suggestion. Björn, please tell me
whether this addresses your concerns.
Regards,
Nikita