Re: [RFC] Clone with v2

From: Date: Wed, 14 May 2025 20:06:18 +0000
Subject: Re: [RFC] Clone with v2
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Wed, May 14, 2025 at 8:06 AM Volker Dusch <[email protected]>
wrote:

> A couple of weeks ago, we stumbled over the fact that the original "clone
> with" RFC was abandoned and thought it would still be useful to suggest a
> trimmed down version of the proposal.
>
> The main goal of this RFC is to propose a lightweight, low friction
> implementation of this feature to satisfy the couple of use cases we see
> and "round out" PHP in how it handles cloning, especially around
> read-only-properties.
>
> https://wiki.php.net/rfc/clone_with_v2
>
> We are actively looking for some feedback on
> https://wiki.php.net/rfc/clone_with_v2#open_issues,
> but of course all
> points are welcome.
>

The only question that arose for me is: what happens if a property name is
provided to clone() that does not exist in the class definition; what
will be the behavior at that time? Will an exception or error be thrown? If
so, will it be a new one, or an existing one?


-- 
Matthew Weier O'Phinney
[email protected]
https://mwop.net/
he/him


Thread (26 messages)

« previous php.internals (#127360) next »