Re: Re: [RFC] Clone with v2
| From: | Tim Düsterhus | Date: | Wed, 21 May 2025 15:33:46 +0000 |
| Subject: | Re: Re: [RFC] Clone with v2 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127418@lists.php.net to get a copy of this message | ||
Hi
Am 2025-05-21 17:27, schrieb Theodore Brown:
Yes, the implementation in the PR comes without any function call overhead. The logic to support the named parameters is purely implemented in the parser. The actual function implementation is provided to “round off” the implementation and because it was super simple to add. Best regards Tim DüsterhusCombining named-parameterI really like this idea! If it can work without any function call overhead, it would enable more ergonomic array creation not only forarray()syntax with clone taking a array as the second parameter would allow for the following, which might combine the best of both worlds?clone($obj, array(foo: 1, bar: "baz", object: "this is not blocked"));clone()but also in many other common scenarios.