Re: [RFC] Clone with v2

From: Date: Sat, 17 May 2025 23:22:15 +0000
Subject: Re: [RFC] Clone with v2
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, May 16, 2025 at 9:41 PM Nicolas Grekas <[email protected]>
wrote:

Being able to update a readonly property even if __clone already touched it
> looks critical to me because otherwise, it'd mean that adding a __clone
> method after publishing a first version of some class that has no __clone
> method would be a BC break.
>

Great input. Thank you Nicolas.

While this only applies to public public(set) readonly protected readonly
properties that are also then *touched* in the new clone method, it is
indeed an E_FATAL with the current implementation.

For these cases, that would indeed be an annoying gotcha, even if I don't
have an example at hand, it might make sense to me to account for it. I'll
update the RFC and publish a changelog on Monday, and I'll mention that
there once I had another look at the implementation.


-- 
Volker Dusch
Head of Engineering
Tideways GmbH
Königswinterer Str. 116
53227 Bonn
https://tideways.io/imprint

Sitz der Gesellschaft: Bonn
Geschäftsführer: Benjamin Außenhofer (geb. Eberlei)
Registergericht: Amtsgericht Bonn, HRB 22127


Thread (35 messages)

« previous php.internals (#127394) next »