Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120082 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18033 invoked from network); 20 Apr 2023 17:17:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2023 17:17:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C5736180211 for ; Thu, 20 Apr 2023 10:17:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15576 212.103.64.0/19 X-Spam-Virus: No X-Envelope-From: Received: from mx.kolabnow.com (mx.kolabnow.com [212.103.80.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 20 Apr 2023 10:17:39 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 43A671BF1 for ; Thu, 20 Apr 2023 19:17:38 +0200 (CEST) Authentication-Results: ext-mx-out001.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20160331; t=1682011055; x=1683825456; bh=ojz45gt/8bmHc5KB JIOBRz8rxDihdJktdp7TjHF6E1U=; b=wGdEOFzuScHKsP33RrEpv81MC8OoMT2A mNH4voHEPA6QFCBRRzqIySZA/Q9TKMQod1qetbhcr/2YSC6H3EwV2OVJbd7gay2e Zvwn/Vb0TBanWOOwZx7vttU/VocV4gkuRgg4WDFODZn2fm3Z0GBvq6qu064aaDJs 4VusCc/BnwJnSke9RtNBSlxl+KTIRfcEpGFjdLhDbhSMtXA1mD1fxnBc9RMRw4hr 7TtH3X9d1T7Bmkr/5A84pGs7b/PXX3OxVrKAnPHXJqnvRZ9crOOE1xUz5lSozo9x Eojszy9odpxc4NtoGGNZGwTmH293y6CJDOsqaxgKkIWsjNfI5RfzwPptrz/Ek52/ OdyThNEjbAdl/4kmlFttZvlX1tMkyK2uFiRZ8HjRSFJKCfnxneawJsJRW7HCQr9S GN0E6b/Ld/JJQ0ztKgpU5UfNnu/10IoAKF28UiRCg3MfaLkk9VTiue0mhbHIHxoN SQURLffMCc8forNU6THXk/V0dPCwdCfWlFgeu4WRQL+RoAUUA/xts1KmP0DThbbM QI9QPj0hT833hhzPUrGGy32iuhuCxozJ1nXqMJnYzm2SSCe1agwUjugfFhPE4p3r kTEsJDwAC9YK7K3I1lN/eV5cDCNr1bucoledQpc1OasVgqk6KWl9E8xV7BurMdah oDwe4iB3mbg= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8DMoC5H94xeX for ; Thu, 20 Apr 2023 19:17:35 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id 7212A155D for ; Thu, 20 Apr 2023 19:17:34 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 89F3E31B for ; Thu, 20 Apr 2023 19:17:34 +0200 (CEST) Message-ID: <6e5dfd26-a333-de65-890f-5abc9dde91d1@alec.pl> Date: Thu, 20 Apr 2023 19:17:33 +0200 MIME-Version: 1.0 To: internals@lists.php.net References: <687944e3-75ec-446b-bbd6-6d3d6856e864@app.fastmail.com> <1b842b25-c038-f647-67e1-b8c986b7d51d@bastelstu.be> <14DCA246-277A-44EC-B3A5-3809C5BCC7AA@gmail.com> <85835836-becb-d995-8966-9f996e0839b1@alec.pl> <55fe1b11-b3a3-4108-9cc4-900012d3116f@app.fastmail.com> Content-Language: en-US In-Reply-To: <55fe1b11-b3a3-4108-9cc4-900012d3116f@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Clone with From: alec@alec.pl (Aleksander Machniak) 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