Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114789 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80242 invoked from network); 8 Jun 2021 22:43:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jun 2021 22:43:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF2171804AE for ; Tue, 8 Jun 2021 15:58:19 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 8 Jun 2021 15:58:19 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id d196so16821201qkg.12 for ; Tue, 08 Jun 2021 15:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4hjGeLKjOwNpikdHY61DPR2rZXU1xDlKaUd7kkqqEis=; b=v0C7NEnkrm3JdglGXK6r5CMIGa08X+qJsWRNJC0w9Y7f78gFHmXr3BCE7flwiv/kJ1 Ob2L/5ZUCxCeP74bC5Af3kcChqu3vyDAuGdGr1gR8LMI+9qdgks9q1agUBUIVtCnBPDp +Gu9D2vu8DS6oPJXX6yEp68QOkLPlAdMDmUMYr2ziGLJyzhKL6IMJU5q8OoAAm4JgGGD KfLbrlAhpGCrbOcQ1/2axHvjQIsfmWGvRiJl79TL6+XKs8gb19fUA3hd818G1KUD/7Ks WkQq5Z7Oo0ndI7rSrjPXr7ccejiaFbFWmoL14/dMF+RKYfHTnIB3Fst8HrNTxbia2tl4 b9Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4hjGeLKjOwNpikdHY61DPR2rZXU1xDlKaUd7kkqqEis=; b=iWp65lfy1AhXdvaTosTl8weDrXJik2TJrKpzBrF5oWyVfYuT/QviQLGpNxMY+Hog0o JqnNcNnPuREtLjQA62+HmUmHN38gkudwSq6WeoTotuNMglV5kk+iNW1if5sWd5F0yDgr FDAHulPQivnOv3zw2it7f6PFOXw9wBxPSRndC3zA97EX/iOhWeSM/0dMmlUgmiV0JmRo rE/PTxd+NPP3iYYGuJQdn4cKRCgpqD5aW517yNJw/11t6BcOzQ0JDiosb552w4XYLUaX nz+pdaHBYtUaf6PLFqjDwV3LLLWQomCeuRIfMJZ+phVTW+peYyN+1ZqDfaBfIYKD3XPu Ni2Q== X-Gm-Message-State: AOAM531NgS3LAY+9iXS5HSae5S47h/WIn4DDdlQNcBYsaVIy0Js4QWxY H/FCvt82ud9dcUwQ4wf2tf1/cA== X-Google-Smtp-Source: ABdhPJxOyLvyUEG2x/AYlbddhNKPbXpQ0C3UTXHJxPMiAtcQi5VZHIXD3ixxm2cR3Qwn8pYU6pBcow== X-Received: by 2002:ae9:df46:: with SMTP id t67mr24470514qkf.448.1623193096003; Tue, 08 Jun 2021 15:58:16 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id 104sm11755660qta.90.2021.06.08.15.58.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jun 2021 15:58:14 -0700 (PDT) Message-ID: <6C85F9DB-158F-4DEC-999C-F1D91406D029@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_966A5C3F-60DD-4055-A2D2-4C5D98EE04D3" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) Date: Tue, 8 Jun 2021 18:58:11 -0400 In-Reply-To: Cc: Larry Garfield , php internals To: Nikita Popov References: <83a9d0ab-60b8-4939-8be9-bdd6ddeb46c5@www.fastmail.com> <9e921668-369c-41f2-a207-856cd098a3f1@www.fastmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.6) Subject: Re: [PHP-DEV] [RFC] Readonly properties From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_966A5C3F-60DD-4055-A2D2-4C5D98EE04D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 8, 2021, at 5:18 AM, Nikita Popov wrote: >=20 > Well, I think we can get an approximation like this: >=20 > = https://beta.grep.app/search?q=3D%7B%20get%3B%20private%20set%3B%20%7D&fil= ter[lang][0]=3DC%23 = > { get; private set; } 74,281 results > https://beta.grep.app/search?q=3D%7B%20get%3B%20%7D&filter[lang][0]=3DC%= 23 = { > get; } 156,304 results > https://beta.grep.app/search?q=3Dreadonly&filter[lang][0]=3DC%23 = = readonly > 409,585 results >=20 > Note that the "{ get; }" part includes both readonly properties and > get-only abstract properties, so that one is an overestimate. Using > variants like \{\s+get;\s+private set;\s+\} doesn't change the results > materially. >=20 > Unless my methodology is completely borked, the ratio of readonly to > asymmetric visibility seems to be something like 4:1 even as a = conservative > estimate. When you two are speaking of "asymmetric visibility," are you speaking = of this RFC[1], this one[2], one I am not mentioning, or one that does = not exist yet? If you are referring to [1] there is more to asymmetric visibility than = what C# would call "auto-implemented properties[3]." =20 If we search for `get {` we find 266,859 occurrences and another 5765 = for `{ set{`. I assume `readonly` would not address either of these? = https://beta.grep.app/search?current=3D2&q=3Dget%5Cs%2A%5C%7B®exp=3Dtru= e&filter[lang][0]=3DC%23 = = https://beta.grep.app/search?q=3D%5C%7B%5Cs%2Aset%5Cs%2A%5C%7B®exp=3Dtr= ue&format=3De&filter[lang][0]=3DC%23 = =20 -Mike [1] https://wiki.php.net/rfc/property_accessors = [2] https://wiki.php.net/rfc/property_write_visibility = =20 [3] = https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-a= nd-structs/auto-implemented-properties = P.S. You also over-counted `readonly` by 44k. If you go with = case-sensitive for "readonly" you only get 365k. Seems they like using = "ReadOnly" as part of symbol names. https://beta.grep.app/search?q=3Dreadonly&case=3Dtrue&filter[lang][0]=3DC%= 23 = P.P.S. I'm not taking a position pro- or con- the readonly RFC, just = wanting to clarify the stats used by others to evaluate. --Apple-Mail=_966A5C3F-60DD-4055-A2D2-4C5D98EE04D3--