Re: [RFC] [Discussion] Clone with

From: Date: Tue, 13 Jun 2023 20:43:49 +0000
Subject: Re: [RFC] [Discussion] Clone with
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-120567@lists.php.net to get a copy of this message
(Resending my earlier message to Levi:) Hi Levi, I apologize if this has been discussed before, as I have fallen very > behind on internals discussions. I think it would be helpful to add an > example where the object being cloned accesses its properties. > Something like this: > > $b = clone $a with ["count" => $a->count * 2]; > > If this is not valid, or if it has unexpected behavior or semantics, > that should also be included in the RFC. > It hasn't been discussed yet, but thankfully, there's nothing special about it: the LHS is evaluated first, then comes the RHS. Nevertheless, I've just clarified this in the RFC, and thanks for pointing this out! Regards, Máté

« previous php.internals (#120567) next »