Re: [PHP-DEV] [RFC] Clone with v2

2025-05-16 Thread Rowan Tommins [IMSoP]
On 15/05/2025 18:56, Stephen Reay wrote: I agree that no __clone and an empty __clone should behave the same way. But as I said, I believe they should behave the same way as they do *now*, until the developer opts in to support cloning with new values. I think what Andreas is saying is that t

Re: [PHP-DEV] [RFC] Clone with v2

2025-05-16 Thread Nicolas Grekas
Le jeu. 15 mai 2025 à 16:06, Larry Garfield a écrit : > On Thu, May 15, 2025, at 1:22 AM, Stephen Reay wrote: > > > I may be missing something here.. > > > > So far the issues are "how do we deal with a parameter for the actual > > object, vs new properties to apply", "should __clone be called b

Re: [PHP-DEV] [RFC] Clone with v2

2025-05-16 Thread Nicolas Grekas
Le jeu. 15 mai 2025 à 15:55, Tim Düsterhus a écrit : > Hi > > Am 2025-05-15 00:04, schrieb Larry Garfield: > > Subtle point here. If the __clone() method touches a readonly > > property, does that make the property inaccessible to the new > > clone-with? > > Yes. Quoting from the RFC: > > > The

Re: [PHP-DEV] [RFC] Clone with v2

2025-05-16 Thread Rob Landers
On Thu, May 15, 2025, at 22:11, Larry Garfield wrote: > On Thu, May 15, 2025, at 2:56 PM, Rob Landers wrote: > > On Thu, May 15, 2025, at 17:32, Tim Düsterhus wrote: > >> Hi > >> > >> Am 2025-05-15 14:14, schrieb Rob Landers: > >> > For example, if you have a Money type, you'd want to be able to e

Re: [PHP-DEV] [RFC] Clone with v2

2025-05-16 Thread Dmitry Derepko
I really like a way with arrays. It allows users to combine what properties they want to re-set and call the clone function only once. Really good catch. On May 15, 2025, at 9:09 PM, Volker Dusch wrote:On Thu, May 15, 2025 at 12:10 AM Larry Garfield wrote:> Please include