Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115179 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 689 invoked from network); 28 Jun 2021 16:02:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 16:02:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8DFA1180532 for ; Mon, 28 Jun 2021 09:22:39 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 28 Jun 2021 09:22:39 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2310332008FC for ; Mon, 28 Jun 2021 12:22:38 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Mon, 28 Jun 2021 12:22:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=VUMJ3E wKc1CbHvjViWuxBuFu/F+BrOujzJvcJPfcNx8=; b=GfW6hTZgCRn7h/Azfn8rzW tKg+r7utOQWXYoqKDSITe1aRAFYEU/I1OUkDnPUsXiGotAKnmOPcYuUYK+yRLV2J NWFBCfPu/paD4uhPEgmKoXR/eET1ve4FTfhGoWrAbqxqq0/7SAbZpF6Z5Yb6toyV as2cLW2XRz/ngdCUursNRmTYYi3+FUSXtFNPH6jzZVWtOXKUCzZAFwhSrQ6hwrWy EKfamyqM/oQbINfoZRo7Ip/RNHrfsay5NdCoXhXSjYn6rUfDbQIEnmHktxwLXVyc 3LoFN8bJEwHpuSkNzZTc5jWVPv1shOWK3ZRs7n1DnyTjp9InQDM3p1QRh0PBMOKA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevheehvdevjeelvdevgfelvefftdejkeelvdekgeeh fffgiedvjefhhfeltdduteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 83459AC0073; Mon, 28 Jun 2021 12:22:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578 Mime-Version: 1.0 Message-ID: <24af2d01-4f6c-4389-a35a-dab50c0b5e66@www.fastmail.com> In-Reply-To: References: Date: Mon, 28 Jun 2021 11:22:17 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: [RFC] Readonly properties From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: > > > I'd like to open the discussion on readonly properties: > > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > > > This proposal is similar to the > > > https://wiki.php.net/rfc/write_once_properties RFC that has been > > declined > > > previously. One significant difference is that the new RFC limits the > > scope > > > of initializing assignments. I think a key mistake of the previous RFC > > was > > > the confusing "write-once" framing, which is both technically correct and > > > quite irrelevant. > > > > > > Please see the rationale section ( > > > https://wiki.php.net/rfc/readonly_properties_v2#rationale) for how this > > > proposal relates to other RFCs and alternatives. > > > > > > > I plan to open voting on this RFC soon. I don't think there's anything > > technical left to address here, the discussion mostly comes down to a value > > judgement. I think everyone has made their position regarding that clear... > > > > Actually, we talked off the list about a way to possibly make this work > with __clone(): > > We could allow __clone to have one argument, the object being cloned. And > when the signature declares this argument, then all readonly properties > would be set as uninitialized on $this. > > A typical __clone function would look like this with readonly properties: > function __clone(object $original) > { > $this->readonlyProp = clone $original->readonlyProp; > } > > That would turn my vote into a +1 if that could be made to work! That sounds like it would support deep cloning, but not with-er methods. There's no way to provide a changed value. It also would mean a lot of work on larger objects to transfer across all the properties. I don't really see what this would add. --Larry Garfield