Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123538 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 qa.php.net (Postfix) with ESMTPS id 5A5DE1A009C for ; Fri, 7 Jun 2024 14:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717770626; bh=h4RfXCAvcpxfXFmoiNO3KmPsaeEjZRfAYImbo2pXPbo=; h=In-Reply-To:References:Date:From:To:Subject:From; b=Q4RoVju87DKNWgZBTeJUdfTZz4u/8gzvIj2zNmfKu40+sTvuUSt4CCIYQKJDx+gSP JaSDvXsL1VtBs1T0Cu+nXR0NAVSZ+5QbB/1whycOaXq3QjTbLk0SMo45q2nyRCV8Uw FEdj0nEbwPkIDlk5j40mrUFw40piqrVg242euLoBbrELW+kSsGQZtdNik1VRHRJ/Tz +aotXvRr6VZCGeLgmjhY/2fWF/emh6DokZT4/juduD9Yg0e6oMWw/v3m/oidSg5e1Q 4cWTZirtORclLnMwFKnBLqGLjjhRUfcLYjyUuRS/Ne47pD9AVu4bvqdtmmhra3vm72 5RbiAJ+DfEmsg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C9E1A1801EC for ; Fri, 7 Jun 2024 14:30:25 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 wfout2-smtp.messagingengine.com (wfout2-smtp.messagingengine.com [64.147.123.145]) (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 ; Fri, 7 Jun 2024 14:30:25 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id B0ED91C00199 for ; Fri, 7 Jun 2024 10:29:17 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Fri, 07 Jun 2024 10:29:17 -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=fm1; t=1717770557; x=1717856957; bh=6WWSgaoX0VmVgDmSyvjFs sQ7Q6RAlOCh/TmIrC2/P70=; b=cxbbOH8WNVMaany6tCBj5AqVYhE5B7AMV1WoR Xb+cC01GqDRHCf5QSRMmAf3zd0RYRXLCMEObqdK7yAn5F93Xc1mcfuSoRvQ8d2HJ uatAjxXVZn4P5TMAk1oD0jnRjJRjgiWrwklXpF7IjgKB2Xqpi5OuqXaB3WcGUyIz msdKyoiU2q1OVvGXRTgtDK9qITv/qIMGVNSBR+IHVR7CJx+55RmZFNLmCa8gXwDn lbry7Ew8B12UN1pZPzaa0cFIulEBmXa1NTUkPEA4zXD7e3O68JqjkJgLZcNB4TuS DNF1/eYqru3f2PvhhNxeR8y8vqbnkO4So01Nm41djsmT9eW1g== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717770557; x= 1717856957; bh=6WWSgaoX0VmVgDmSyvjFssQ7Q6RAlOCh/TmIrC2/P70=; b=W ID0SlIyhORjEdEBtMr2t6UVuoF02eGWL+tctBqfhC70jrHr3S5iWuQ/rt7XBbg5V CI8XIdKHovcm1pt4xJ4VUAtihxESf/NNoLY7IUCc6j8pocVS/qk7kvK/yLW3CQOo JXPUNm1zB0idwif3UrNDoei2NUA/xMMdDftUdiRvE75kmHmqB6wfXGuCQXG3cCci K/yoctQ0+N8B34jJ+st9XQyilZEhbdbIE7VOkUVfVZEqCd1i/zdqfcxxKh86SOGo D9Ts8xQCSwVwHF3tKO+/h3vI550ooyjB59rI0hiY50krCzn48xsnErbWP2V9GYTU l/csd8kJ5vt+BxqDv73+g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtuddghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepofgfggfkjghffffhvffu tgfgsehtqhertderreejnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoe hlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhep keekheeludfgheehgeekfeevtdevtdetffejhfetgfethfejudetieeiffdvjefgnecuff homhgrihhnpeefvheglhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B83A11700093; Fri, 7 Jun 2024 10:29:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <0b6d7308-3c32-477c-8bf2-e8e0880cbb05@app.fastmail.com> In-Reply-To: References: <0a6a61cd-f203-4dea-a7f8-97e6b885c52d@app.fastmail.com> <734bb8e8-2fdf-4e50-9039-e53c99ee4930@app.fastmail.com> <89b695d7-661f-4c1b-ac4c-4480ad158e83@app.fastmail.com> <6d644f0f-cbeb-484c-b267-bf1d97e6d27a@app.fastmail.com> <10AAAA51-9538-4F97-83D1-91F154C745F7@gmail.com> Date: Fri, 07 Jun 2024 14:28:56 +0000 To: "php internals" Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jun 5, 2024, at 7:55 PM, Arvids Godjuks wrote: > On Wed, 5 Jun 2024 at 19:59, Claude Pache wro= te: >> *snip* >> Hi Larry and Ilija, >>=20 >> Thanks for your work. Here is my opinion: >>=20 >> First, I do think that `readonly` should integrate with aviz, unless = that implies truly controversial changes on `readonly`. As Theodore Brow= n commented in the previous version of the RFC: =E2=80=9CProposal feels = unfinished since it can't be used in conjunction with readonly propertie= s/classes. In my opinion the issues with this need to be resolved first,= to avoid the language moving towards a messy hodgepodge of features tha= t don't work well together.=E2=80=9D >>=20 >> Second, I think that making `readonly` implicitly `protected(set)` by= default (Option 2) is the way to go: >> * At first glance it is an expectation change. But, in reality, all r= eadonly properties can *already* be written to from a child class as of = today: it suffices that the child class in question redeclare those prop= erties: https://3v4l.org/9AV4r. From the point of view of the child clas= s, the only thing that will change, is that it will no longer be require= d to explicitly opt into that possibility by redeclaring the readonly pr= operties. From the point of view of the parent class, nothing will chang= e, except false expectations=E2=80=94and it is a good thing that false e= xpectations are eliminated. >> * Relatively of Options 3 and 4, Option 2 leaves the language in a mo= re simple and regular state. That's a valid point, actually. The implicit "private(set)" is already = untrue because of readonly-specific workarounds to enable redeclaration.= Switching it to implicit "protected(set)" would remove that special ca= se, and still allow an explicit private(set) if desired (which would the= n imply final). Since no one else has weighed in, we'll go with that route: readonly on = its own changes to implicit protected(set), remove any special casing, a= nd then readonly and aviz should be safely compatible. I'll update the = RFC and Ilija will confirm that there's no implementation gotchas we're = not aware of yet. > Hello everyone, > I've been seeing readonly bashed/blamed/being roadblock, etc, etc as i= n=20 > the implementation ended up being sloppy and blocking other things or=20 > making things hard...=20 > While I know BC is king and stuff, why not just say "yes, this was=20 > designed badly and we will redo it" and just do it? While there's not=20 > yet an absolute boatload of that code out there when it would be=20 > absolutely massive BC break? Don't repeat the mistakes of the old days=20 > :D Well, readonly has been out for 3 years. There is an absolute boatload = of code out there that we do not want to break. :-) > Cause the impression I'm getting any significant RFC now has to work=20 > around the readonly's sloppy implementation and there's a bigger and=20 > bigger section on that with each next RFC when there's more and more=20 > advanced features for the OOP part of things. It's not a sloppy implementation per se. (I can't actually speak to the= implementation myself.) It's the design of an implicit private(set) th= at works differently from any other private variable. The issue with "t= hou shalt not touch it outside of the constructor" isn't a language bug,= it's a static-analyzer bug that those projects refuse to fix. Not some= thing we can really do much about here. Uninitialized wasn't introduced= by readonly but by property types in 7.4; readonly just inherited it. = For hooks, the issue is that readonly needs a value to check to see if i= t's uninitialized, and with hooks, you don't always have that. I think at this point, the change discussed above (making it implicit pr= otected(set)) is the best we could do. In an ideal world, we would have= never added readonly in the first place and just added aviz back in 8.1= , which would cover nearly all the same use cases with fewer edge cases = and oddities. Sadly, the world is not ideal. --Larry Garfield