Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120079 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5829 invoked from network); 20 Apr 2023 14:15:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2023 14:15:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BB1BC1804AA for ; Thu, 20 Apr 2023 07:15:51 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 20 Apr 2023 07:15:51 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D9E015C013C for ; Thu, 20 Apr 2023 10:15:50 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Thu, 20 Apr 2023 10:15:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1682000150; x= 1682086550; bh=iF4UY5oUOx2LbR3bisPwFmgNIHHnovsigaMKEKuWLsQ=; b=m ZKdKVW9ixT2wDLJK55NiY68i8EnHtDrLBl9fpsCNz2OzYvEu1e3qWzqWWyetzhAK YP1iifpIA6IT3OT6PB2FQzHsiLIuKI/7l0bKcX4n3povFGkKIJTTqomYv6hNIA0a ww/d3Wh/FQWlsihp8WM+575iLz0epayOna5ji2lIoD9eiipUSIJ+gnMkvOdNUiLt rpv1fPSriuPpG3lJc/s4xnQafdzzwky6WG7lOAMHnicvaoDj10ghhkZ6Dts7MCjC RC61berjEWraAwdvb7y+wqXOAi2XnDQBlNAYawQZNX646rgkaWKr8NBdWszuyhKB ket9kl1adzYbw+Uc+my/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1682000150; x=1682086550; bh=iF4UY5oUOx2Lb R3bisPwFmgNIHHnovsigaMKEKuWLsQ=; b=OEvi3PKHRbM7G2vDzz+OMQKGSkTnA /BFLEC08/aHjkdM90FZkvirQuS/7GVDkSM5h8DLv6xuy1UZ/cS4HPlRRCxSqLeUn 5l8PxYxOjfxDyfwSqCAO4QZShuq8R/6Y2Qm79+Qcyp+uEehyX9qm/gEgxpoEwJQY 0MCHzrPcObhR0njtFQyWRYV9o9ezXOKACzVYQOVFdgq+BYalRK0DTcU+bH527r4/ 6q2w4z5Y1i1Cb1QIMqyJQ0IMtf611mGb5O7h8xUEt7vJzLdXiu4NXIcOu1E2UIBo rhPexLRMeWQFXgOTClEzw3RD9+4H4Gx3spqQcrGHs9deYIcwXrPbT0ygA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtvddgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeejlefgvdegkeeutdffvdegieegueetffejueekvdeu veeifeeuudelgfduteefgfenucffohhmrghinhepphgvrghkugdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghr fhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7464D1700089; Thu, 20 Apr 2023 10:15:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-372-g43825cb665-fm-20230411.003-g43825cb6 Mime-Version: 1.0 Message-ID: <55fe1b11-b3a3-4108-9cc4-900012d3116f@app.fastmail.com> In-Reply-To: <85835836-becb-d995-8966-9f996e0839b1@alec.pl> 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> Date: Thu, 20 Apr 2023 14:15:29 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] [Discussion] Clone with From: larry@garfieldtech.com ("Larry Garfield") On Thu, Apr 20, 2023, at 7:22 AM, Aleksander Machniak wrote: > 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(). 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. :-) --Larry Garfield