Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118997 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80459 invoked from network); 13 Nov 2022 21:57:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Nov 2022 21:57:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B62418004D for ; Sun, 13 Nov 2022 13:57:43 -0800 (PST) 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, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 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 (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 13 Nov 2022 13:57:42 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 853C532000F9 for ; Sun, 13 Nov 2022 16:57:41 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 13 Nov 2022 16:57:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc: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=fm1; t=1668376661; x= 1668463061; bh=auWw8incUC7E7Jb2uf1lRO1BvAEgBJfY1aYIRpbfJzM=; b=n YyZYiCYJrHMgtqeLOQr04RMBGcGSwnBF73p1wVNjZWS/PIhY8noGqKgMjmAXe02q F7kXE1NClLtZumP+CB/IFgVxj75P8hxlEXmzuMrX0v3YLRDFxoix65Wth23QxiWv /X7+jzRynZP9z2ljRGDv4fGmcgVMCBuKpKw70m3xggbmnL5HkQ9djyzuXxQ0Avs7 8KUJSuviR5GdU7fYLTFwy84MkqstZbVskRPaZC3DCoiees86Qe8EB4VZ4OPyyguA VcC1emu84pAmCMA1+wkeej+258YQL5KiuGkoS8g/3JI/L74os4Yf29eRgXha3USL JOgSG7w9zRJrLjMC4kvbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= fm1; t=1668376661; x=1668463061; bh=auWw8incUC7E7Jb2uf1lRO1BvAEg BJfY1aYIRpbfJzM=; b=N6IwMWbgeeYSaKVe4q7dLjQJr+E1Ze1s9etfRnsIZnSY qRE/usm8rto6gXWqGTbVf3gdJy2bW3g2JQ+NwWadQF3uBv9tGIc9J4y18EIpk2ee eqSYFSAkY9cqy3Fj6GGmxPiTIAAld/7KH1y2o9Vjj1pDTgtz3Ou8pINx726QXjTh B9r5Z3WjDp7+1t8ce9KE99r9ePRHCtl9Za4vRiff2OIUkB+LZ9/PHq1mGF7Rs5Kj tUyzKxIIqne93HC7Vx4Q9R0vKjcLEGT0aNRgyg/QqugK+SBXyKVC4MoNj5obMREO hSP+ZPYhmQU+X8SMyW4o1L5tSWXtowOYWvm2ubSrkw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedtgdduheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E37981700095; Sun, 13 Nov 2022 16:57:40 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-ID: In-Reply-To: References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> Date: Sun, 13 Nov 2022 15:57:20 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: larry@garfieldtech.com ("Larry Garfield") On Sun, Nov 13, 2022, at 3:50 PM, Deleu wrote: >> >> >> 2. `readonly` is a "write once" flag that may be combined with asymmetric >> visibility. If no set visibility is specified, `readoly` implies >> `private(set)`, but a different set visibility may also be provided. >> >> These are both reasonable rules. However, it creates a conflict. >> Specifically, in the following cases: >> >> public public(set) readonly string $foo >> >> protected protected(set) readonly string $foo >> > > What if the implicit rule for `readonly` is changed into `protected(set)`? > Let's run with this for a minute. > > 1- It's not truly a CODE breaking change. Right now if you have a > `protected readonly` property, you're either calling the parent constructor > or you're never making use of the variable, otherwise you're getting a > Fatal Error. This is untrue. You can declare a private property identically in a parent and child class, even readonly. I'm doing this now in a project. It works, but would be unnecessary if the parent's property were protected(set). --Larry Garfield