Re: [RFC] [Discussion] Clone with
| From: | Aleksander Machniak | Date: | Thu, 20 Apr 2023 07:22:11 +0000 |
| Subject: | Re: [RFC] [Discussion] Clone with | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120077@lists.php.net to get a copy of this message | ||
On 20.04.2023 09:00, Rowan Tommins wrote:
Rather than making everything use an array or array-like syntax, I would probably go the other way and scrap the special syntax for dynamic names, making the whole thing look like a function call, with support for array unpacking: $point = clone $point with (x: $x, y: $y, z: $z); $point = clone $point with (...['x' => $x, 'y' => $y, 'z' => $z]);or $point = clone($point, x: $x, y: $y, z: $z); Also, I didn't see it mentioned, but maybe for future scope, these new arguments should be passed to __clone(). -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com