Re: [RFC] [Discussion] Clone with

From: Date: Fri, 17 May 2024 18:07:35 +0000
Subject: Re: [RFC] [Discussion] Clone with
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-123337@lists.php.net to get a copy of this message
Hi On 5/9/24 15:10, Andreas Hennings wrote:
The syntax is well suited for the most common case, which is regular wither methods for one or more known properties. I don't like the array syntax as a default. It has inferior DX for regular withers, and possible performance impact from the temporary array.
Again [1]: The choice of syntax cannot influence runtime performance after the code is compiled, because it is just that - syntax. It would be perfectly possible to specifically handle the case where the 'with' is followed by an array literal and then not construct a temporary array. In fact this is how the current implementation works: It doesn't actually support arrays yet, it just borrows the syntax of an array, because it more naturally extends to supporting arrays in the future. Best regards Tim Düsterhus [1] See also my previous email: https://externals.io/message/120048#120073

« previous php.internals (#123337) next »