Hi On 4/19/23 17:26, Andreas Hennings wrote:
I wonder what this means for performance. Will the expression always be evaluated as an array first, and then applied, or can php do a "shortcut" where it internally treats it as an argument list, even though the syntax implies array? The different will be small, but it could become relevant if called many times over.
I've said it before, but I'm going to say it again: Performance should be low in the list of things that decide how a feature will look. Opcache and the optimizer can always be improved in the future, syntax cannot.
Of course if a feature is unacceptably slow, it is a non-starter. But in this case I expect it to just be "there is optimization potential", as creating an array with a handful of elements shouldn't be unacceptably slow and also 'clone with' is likely going to make up only a very small part of a request's entire processing.
Best regards Tim Düsterhus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php