Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127364 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 025CF1A00BC for ; Wed, 14 May 2025 22:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747260178; bh=sUPAw6zN1dNlFqjOAiMmAEc4PXbNZrZnu1YGlTIt5fQ=; h=Date:From:To:In-Reply-To:References:Subject:From; b=hlwuST+57d3HIg6UY483l38DgrfXDVkiPRTgtkh4cbC6uwRkCZ6qJTuJRGxWt7BDx krhSBIiO26vmnXWbVou5hhV/v5Pn0vDPrCSJvfXeVIVoeJtFVIiRtYKEG6H1MQN0tT ANDp56tt0Fk7b9z0k722Vcy4SHEGEGzi3WnRBCemJ+iLSZTRXmu8fw+qLTdd9wRFoC 9Y1yxvvL6obB/KFRBenYu+kovVj6mdci7z6GfTaifMB1swJh1DD3Mv7J4MtzD/8OxL O7NFl81peRkHkKl6/MmQkMFnt5oVAIWzlmNoNgrOUK90CUvj6TnRswdl8iMcjGrSVS u7kiiwXm6LPKA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E924C1801D9 for ; Wed, 14 May 2025 22:02:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 14 May 2025 22:02:56 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id ECBAA254011D for ; Wed, 14 May 2025 18:05:06 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Wed, 14 May 2025 18:05:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1747260306; x=1747346706; bh=Y03cFPufCYOzfAsInNBZM ZTOQCdTzaUMsdRMfRM4HJA=; b=bmERmsVxt77rSxQbmUb02mmBbyIq8dTultnuw eCt8ixap6SYfveJHnec7+wZUDNsDVeEyK81Q3D7cEQYll6OqtYIubziLLW7nxpop IYeRJC10JVi/Z6/4PPIOu5fn6eZi4VeutOZ9LUE2SHv56aPCqBc6PMy03IWgoi3Q LwYmLmgs4NIwOMHEx0Kmu819C1R9TntN4u1oM/zdyzejh99SXso7bOQqfRORSrIA 2x/oC3/DZY8L9rurT4di17Idi5YMkGMsjbx7elkHgw7pMWlDVk0SSq5H71pVDWKn BGc+0AVpIOB7Qn/wmm1bXyNrRuuJxLDJQNNGxBiIGbXmpEuLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1747260306; x=1747346706; bh=Y 03cFPufCYOzfAsInNBZMZTOQCdTzaUMsdRMfRM4HJA=; b=lYiKF4oYYLNPsSOIy YtzcqdZ+RFoPDFpfTCVawSIcPz/0uuX1bclY3o3wpgytgl80AYYcPPpA0D2pj7HI wqqv3SqwrUDzP/j4U2fKpzd7wKgDU+tgFdzIN5dYyq+zvy6kcmd5GIXjLxAHdlZn RF7OECisexQ2AzG+QiZVYZ9QP0SvDWwjS5v2DMtGVdoxqvlj7YU7A9/YqjQmLaE1 ZmjDyMGz6WueUFUZnC1HyaHFJFWzMbGPmFl5zz1O+mq5KlU7/GzqUT1bS3e9g1vc KqnWRu9ru6Pz8AWxyHIQbn/jh0yzaXES1XHinystqgTgdseSFwQyH/t+JtyggRlJ 1FK7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftdekudegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeffieeivdfhvdeguddt tdegteeiueegvefhteehfeeffeetudeitdehtdegjeeuieenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlught vggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 709BB70005D; Wed, 14 May 2025 18:05:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T11f5e8d0f54ccf80 Date: Wed, 14 May 2025 17:04:46 -0500 To: "php internals" Message-ID: In-Reply-To: <4a703db4174763586d84b9bf5606ff31@bastelstu.be> References: <4a703db4174763586d84b9bf5606ff31@bastelstu.be> Subject: Re: [PHP-DEV] [RFC] Clone with v2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Wed, May 14, 2025, at 4:00 PM, Tim D=C3=BCsterhus wrote: > The internal implementation is roughly equivalent to: > > $cloned =3D clone $object; > foreach ($withProperties as $key =3D> $value) { > $cloned->{$key} =3D $value; > } > return $cloned; > > Just with the exception that writing readonly properties is allowed on=20 > the clone (unless already touched by `__clone()`). Subtle point here. If the __clone() method touches a readonly property,= does that make the property inaccessible to the new clone-with? Or is = it a separate "unlock scope"? I would expect the latter. A single unlo= ck block would be confusing to me. --Larry Garfield