Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127379 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 2F3311A00BC for ; Thu, 15 May 2025 14:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747318511; bh=LUi1YSUuBnoq7boKbHQligz36IuHNgvx0ZTyfFxHT8s=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Fg7ilc+MjLmGSn4wzYc4JgwFSiuutDVUGCVCQRXinXAJOZDPKm10S4nxwgD7GhYu+ xSSfzvLqUSqnXkEQ8SJzZslfLsDRwoda2s9xCiFrZQp9iyiG7UVCTm61S7UKCQ3TBj wQU5Ax449E3NsNJkpwFlPyR0eawycXEzeZK4NxJSwyVocllYagvyYPStgee/jZYqE7 qyrLwu3zia1cEa2r95fa3BEBx7wV4FhZ8Sh3Y/yqEBOEfqN8QSlDnX69JPkapw8e5F gqCx07ycga6EcFKGezU5m4ioFsSOokwPv0HH6F7LFBkgzG5dX7prtt/A/WdZVjntik w95zcWE4zqBig== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7623D18006C for ; Thu, 15 May 2025 14:15:10 +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_40,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 fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 ; Thu, 15 May 2025 14:15:10 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 5600113801F5 for ; Thu, 15 May 2025 10:17:20 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Thu, 15 May 2025 10:17:20 -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=1747318640; x=1747405040; bh=R7PqWbI3qLrEZxq36uexu MyqAnzDAqhctN8ARzzlvyI=; b=rCJeDzdjiR7EjJHGXWAKjnihiZlJDuqQwn+EV E1tP+CwpzOOUFPvJL9I1aRvDpdHSC+cOvAua/UQ9/wXEJJoNpuzedRiRVrH/vNmX Wl0epJv1rJcdEVzKnJ35pW7yK4ORh5gw5xZyS2rAQJOVcUfynzn6s7+iX6MLNAxT ry9quaxGg5p8WHwNxdjfegHVllZTQlaKTyC+A+XCmzMg7i8gGZ66gKAkW7gXyKiZ 2ecPLcLziysYVnNz80xHwm8uuA8b2dtKMv98UOgI0a87+QuaV/OW7Q42aAVWW253 AmRYXBjV5B7qw0BD38QmU3pwyeveNWaKfGGA7oSAMq3HNvViQ== 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=1747318640; x=1747405040; bh=R 7PqWbI3qLrEZxq36uexuMyqAnzDAqhctN8ARzzlvyI=; b=iPxf2ieZf9X5myR5Y NkVgLW521KO34e+cV7vzYQWhXSuVSrZfWVXV6BSL1/HOOrs9OEluSdt/RHGyRi2+ IQTNOBf0Ko4s/CSC4ev9bHufYWxwa9CreEfL//7+CudC4WG/Y86FGjv7foOrdxOO hr9yUBSlyxNYzx/7CmwV7wBrOb2Vs4zQnk+XIckvYUTAh9L7gaxWTgbXJvRh+Up4 cIEd6Zea/SDoEHAP1mJl8mwEdgkuPNWCDKXILVZR4SWVLaeZ5MzhKnOgaVZj6Isz yeytI2HGVMkLjcZugCM9jQ7q+19vXnbX3adlsYdcXGw8u5GlZJLRCdejmAYDLsIz OVgjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefuddttdekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeeugfetieejueevffdu lefhhfethfekvedtueevgfffvdefiedvtefgheevteelffenucffohhmrghinhepphhhph drnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghpthhtohepud dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishht shdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 1316E70005E; Thu, 15 May 2025 10:17:20 -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: Thu, 15 May 2025 09:16:59 -0500 To: "php internals" Message-ID: In-Reply-To: <956887e5b66e2b43459b999ebac2069d@bastelstu.be> References: <4a703db4174763586d84b9bf5606ff31@bastelstu.be> <956887e5b66e2b43459b999ebac2069d@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 Thu, May 15, 2025, at 8:53 AM, Tim D=C3=BCsterhus wrote: > Hi > > Am 2025-05-15 00:04, schrieb Larry Garfield: >> Subtle point here. If the __clone() method touches a readonly=20 >> property, does that make the property inaccessible to the new=20 >> clone-with? > > Yes. Quoting from the RFC: > >> The currently linked implementation =E2=80=9Clocks=E2=80=9D a propert= y if it modified=20 >> within __clone(), if this is useful is up for debate. > > - > >> A single unlock block would be confusing to me. > > We=E2=80=99ve implemented it like that, because it felt most in line w= ith what=20 > was decided in=20 > https://wiki.php.net/rfc/readonly_amendments#proposal_2readonly_proper= ties_can_be_reinitialized_during_cloning,=20 > which says: > >> Reinitialization of each property is possible once and only once: > > We expect =E2=80=9Cpublic(set) readonly=E2=80=9D + =E2=80=9C__clone()=E2= =80=9D to be rare and from=20 > within the class, the author knows how their `__clone()` implementatio= n=20 > works and can make sure it is compatible with whatever properties they=20 > might want to update during cloning. The lack of =E2=80=9Cuse cases=E2= =80=9D is the=20 > primary reason we made the more conservative choice, but we are not=20 > particularly attached to this specific behavior. > > Best regards > Tim D=C3=BCsterhus Fair. I could probably think of a use case if I tried hard, but I can't= think of one off hand. It's just surprising in the abstract. I suppos= e making it a single unlock scope leaves open the option to split it in = two later, but the reverse is not true. I won't fight for this one, jus= t noting it as surprising. --Larry Garfield