Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114804 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30600 invoked from network); 10 Jun 2021 03:52:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2021 03:52:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B2C851804D8 for ; Wed, 9 Jun 2021 21:08:06 -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,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-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 ; Wed, 9 Jun 2021 21:08:06 -0700 (PDT) Received: by mail-qv1-f54.google.com with SMTP id g12so14008270qvx.12 for ; Wed, 09 Jun 2021 21:08:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JWGtGVLO99jTXR3Uh5UJiN+6uECb3jbP6R7krcM98QI=; b=JOFHJKtxd8yLF2kYBA1xbPSJqfLBRe/oBNvhRn4sezG23iCY0UJLo/daXjlZ9ixfZL jmDTq7T5Aj5JcHDU1G8gtB/9b54uZwUXf4wHt3KWMy9HRLa+qwULfez4d7dfPpecMuh6 e54cHMREYCOuvohM7FkPGS/menwJYrHeK+R7Iw+E7HMbrcKZH9e8LA0jiF8Ce6rgQX2U ISTTvc/gFi5oW32udCaTn+GPECfOR1CjSFaHpzbWppQltkW0A4y3qo+XhE4NSwj5o6Ij cNOz5X2+RiDpdboTzeEheuC9ySn6zXtTrrHia2HFxWdzi+bH1+aOzJFD88E2UvM94XMr Hd2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JWGtGVLO99jTXR3Uh5UJiN+6uECb3jbP6R7krcM98QI=; b=lAEzEycKw4QEQze0kzqZfhuZVymeJqdIThx1Ln99CrhIBrgj0o5Q1UFoq8KUNFpNGF Q7aVzg/HBki/SJXaDyc9ZyUPlxYm0xmGc0esDzaHIeqduRD7D3b6s3eiJHemklIxektC +tiV8PMObKLokOnygnFGgUtaUHNrbP/1QlntkygdSDnK8q1EXGgfpTPYkEMpr693qVNM zZ7ugwBTO4GCxD6Zl9d/PZMWT/62xjm1imFOOZA8iFNSjYLA7D5EJB1RF71naoq8X+nr FEuR6IKY4EaW91xsbQ0ZQqOvg+3gp5Cl8mo9pG+JKrrGQ44lls5r4VhT07x+6CDvc89C Y5hA== X-Gm-Message-State: AOAM530ig29eq+sJcPXylN95hdG7Yj38Uh0jSbg6xDcZRrqCtBisIE3B kRsUoWmt3A0Oa2OugpJmv2h1lg== X-Google-Smtp-Source: ABdhPJzOyCxA9C4ksDpg9U6t60cWzjOeX3j9bsjpC9T5a7gAR7QT0FWTL9w8sUoCAZzcBc82dxPk5Q== X-Received: by 2002:a0c:bf4b:: with SMTP id b11mr3426770qvj.11.1623298085557; Wed, 09 Jun 2021 21:08:05 -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 k124sm1446952qkc.132.2021.06.09.21.08.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 21:08:04 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) In-Reply-To: <7a40dd68-6e44-4b2a-83e2-956fe00c9e6e@www.fastmail.com> Date: Thu, 10 Jun 2021 00:08:02 -0400 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <81EDBC9A-D6C7-451A-8B77-7EE61D1580A5@newclarity.net> References: <7a40dd68-6e44-4b2a-83e2-956fe00c9e6e@www.fastmail.com> To: Larry Garfield , Nikita Popov X-Mailer: Apple Mail (2.3608.120.23.2.6) Subject: Re: [PHP-DEV] [RFC] Readonly properties From: mike@newclarity.net (Mike Schinkel) Hi Larry, Thanks for the response. > On Jun 9, 2021, at 12:51 PM, Larry Garfield = wrote: >=20 > Pierre and Mike: >=20 > "Asymmetric visibility" as we keep referring to it would mean the = "implicit accessors only" version of this: = https://wiki.php.net/rfc/property_accessors >=20 > That is, it would let you define public/private/protected for get and = set operations on a property separately from each other. >=20 > There are three key differences between readonly and asymmetric = visibility as described there: >=20 > * Asymmetric visibility would allow a property to be reassigned = multiple times from within a class, readonly would allow writing to it = only once when it's uninitialized. Whether one of those is too-tight or = too-loose is a matter of opinion and context. When I read your statement I first thought you were wrong, but then I = re-read Nikitia's RFC[1] and realized that RFC stated the properties of = an object assigned to a readonly property *could* be updated, but *not* = the readonly property itself. I wonder if I was the only one who read that mistakenly? Anyway, have either you or Nikita considered making a distinction = between 'public readonly' and 'private readonly' such that one could = disallow any changes after initialization and the other could allow = changes but only within the class? -Mike [1] https://wiki.php.net/rfc/readonly_properties_v2#proposal=