Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118370 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3011 invoked from network); 7 Aug 2022 17:01:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Aug 2022 17:01:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E3D9A180538 for ; Sun, 7 Aug 2022 12:02:16 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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, 7 Aug 2022 12:02:16 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8DDB55C0097 for ; Sun, 7 Aug 2022 15:02:16 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 07 Aug 2022 15:02:16 -0400 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=1659898936; x= 1659985336; bh=juX/hwPqm2ronN4IpHR06nVb1gk7ph5Kc2hjwPmzn5E=; b=C 1Ck/0Gh+mkn3p/ELlZ/15cTEvNbnqrTVHucFpM0jVwDb/uJuoE0D7HbyIAsxRfY5 viSfiOA4G1vwhixKDiFn0YYZ0AC+gPMUTHwfcUwfzttPTCZdKNcHeHKTIcK09J/r 4RjlGWHdiRUHI/rL7AaOGEf8xlW2pqdWWFMSh3EfbVlb26CCWA6dplLiYXNitQns 3U/ZV1+x+zxOIq5OqRE3seK24K2XKtIxQiHkJodo2lb/OJlvvBlabHMWxo8nqk+m 9kV1npf5H5ktf+lvxM/pYELXxXHqubL++tc2IXC/tctmDXVVLp3B+PhqbVka0yaU vxVX0k/qlxrBRN/hTHe5A== 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=1659898936; x=1659985336; bh=juX/hwPqm2ronN4IpHR06nVb1gk7 ph5Kc2hjwPmzn5E=; b=pbPqHS9KGDJfHARcOfXVbb62NEFyvHEzfjQXrtR1Btqq MtcMygW4BvLdh3/PRjU5NFBAisLYGMMg3rjENdDCSyy7x7nZ/uGUGyQpnnIJsKlx MIDp25qZRrM2ijrQj3VFviU/qwm3DzPAv4WCZ5N6erw7HLJdyXL4eQjBXisnSiyf peu2cOXXP+sDxEwXfo0GFbyncxeSjNRrjUCD0UgFp+mwfeJCwTZvqUoS1UAUEAWj T4Lq3F/FiBmJf7gZaA1Cdv7s53FcugJ5Igm1T4sBCPlrrq2zVmDLeiBIVezvjort Uwuq/py3aIKlcxlZkLREWEUlqRxQ9uEg4rylGyXzLg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdefiedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefg ffekudevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4E68E170007E; Sun, 7 Aug 2022 15:02:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-758-ge0d20a54e1-fm-20220729.001-ge0d20a54 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Sun, 07 Aug 2022 14:01:55 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Asymmetric visibility From: larry@garfieldtech.com ("Larry Garfield") On Sun, Aug 7, 2022, at 5:54 AM, Lynn wrote: > On Sun, Aug 7, 2022 at 12:34 PM Rowan Tommins > wrote: > >> Can you expand on where you think the ambiguity / implicitness is? As I >> understand it, the RFC is proposing exactly three new combined access >> levels: >> >> - "public private(set)" >> - "public protected(set)" >> - "protected private(set)" >> >> Although aesthetically it will take a bit of getting used to, it seems to >> me pretty clear that the first means "mostly public, but private if you >> want to set it", and so on. >> >> The only thing I can think of that could be described as "implicit" is >> that accessing a property by reference is considered a "set" operation, >> which I'm not sure how any implementation could avoid. > > > Personally for me it's the syntax. Reading "public private", "public > protected", or "protected private" reads really weird `public private(set) > static self $property`. In the end it makes sense if you know what it > means, otherwise it's probably confusing. I really like this RFC and I feel > like this might just be the way to go forward, but I have my doubts about > how many more keywords can be realistically added before it becomes a > problem. What syntax would avoid having the visibility keyword repeated? if you want "public get, private set" behavior, I don't know how that could be done without having the words "public" and "private" both appear somewhere. Also note, since using private(set) is mutually exclusive with readonly, that the resulting keyword list is about the same length as the existing "public readonly string $foo" that has cropped up frequently with PHP 8.1. So... yes it's another keyword, but it's not more keywords that can exist simultaneously. And moving the keyword to the right (a la C#) wouldn't make it any shorter; if anything it would be even more keystrokes. Very close in size, same in complexity: public readonly string $foo public private(set) string $foo --Larry Garfield