On 20.04.2023 16:15, Larry Garfield wrote:
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().

They should not.  See 
https://peakd.com/hive-168588/@crell/object-properties-part-2-examples .  I 
went through and experimented with different syntaxes, and passing arguments to 
__clone() was by far the worst option in practice. :-)

Sure, I didn't propose it to be a solution for "clone with", but rather, if we implement "clone with" (no matter in which way) this is "cloning an object with extra properties", so therefore one would ask to have access to these extra properties inside __clone(). I'm not sure how useful that could be, but maybe worth mentioning in future scope or somewhere in the RFC.

And I think this syntax should still be on the table, no need for a new keyword.

$point = clone($point, x: $x, y: $y, z: $z);

--
Aleksander Machniak
Kolab Groupware Developer        [https://kolab.org]
Roundcube Webmail Developer  [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to