Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123479 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 DE5CB1A009C for ; Fri, 31 May 2024 17:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717177634; bh=NLA8+mY93023aN1ZpY8smN8ZpjrsK8LXfvkbiYK3O2Y=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=U+Hpxi9/AftPHB1ZofcKaE+5JW5O+8OZwRV6/ECRtysxkMvo7miJA/2AM3YqZ9nrn vMHvWfI+jlAL1vh6GWg+EPsMNFLk3oZ3ZUDO4DEkUgrgcbEBja76u3A5ljL05zjiVL SWCM4e/Z3eO5P7Be1+v4S+oqbmHJ10v1Br5OlsQDbMPX1TIJ3t09Ofyjxn7DCpNSe9 E7Mg71hk2VsAJiRao5VcNN1kr+mvgWxxy9WqnipFLcXmvly+lwyIrpa2bFg92hlpCX nWCXWlceNDqjHURS05PdqeUZZaap3xY5Eds/mLOMyyzaXla2PxjdE0UAqO/z7OqYdt UznCMk5PrCSuA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A70091806FA for ; Fri, 31 May 2024 17:47:11 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,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 mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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, 31 May 2024 17:47:11 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a6269885572so438649666b.1 for ; Fri, 31 May 2024 10:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717177567; x=1717782367; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=fZli7zMiiLHjUNyMCdUnP8Shcci2hUtirXL+DOnRW7o=; b=iRaC26juaS5+a0MbtjfmwieQQQXfKh2xF2OHDzkYllBU/mdy2zBgeGBTD9SQlnX8AN elgF9Z/3qC5wgb0mCb/o9EWmT1cbEGA/sUsnO6Bqbz5J9SZXS2DsUowdmR0iujmzdsSW /0ZJh0PTQXUfsaMMCMa1yLmy+XWAiigpm3XFVY5rSTgfXkydytiiywGTXLQwr9Ovgv5h pan6aKkfx1kqKRn8yi/I7TmYg2tfDOFyjEQw+v6HsJqd56jMkF+uje/n4WMEg9tnAnRi T6XRsmNyw5gx2MIhF9E2Cg8DVAR/VNGVFpjq/U+boKYSlm6CC50L0pkA/1Ns+EFX+HWx VkPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717177567; x=1717782367; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fZli7zMiiLHjUNyMCdUnP8Shcci2hUtirXL+DOnRW7o=; b=vhUHaboCiR86HA49WDyHNc8Thwk+mWrNhADy1zIqkCQVs5gGD+LKxAkeNHefq3f2Yn 6sMDdlKE0KRtaF9chUghd/fuupVf41jun+S/SJMWHx+OrjxlwiVpp6Y5iUkVC6ti2YkL Z7S0yKMlsVrRplP/ZmJP9KaGf2Vvbn9sDy+3itesneJMYsg7xcQ+eahDtSZS3op7mXNV YPPbJwLyyJ7KehqO6gHBk6CmwDr/TN337Hk0p4mJGpSe8gx0nvte2kkmT7cNJWNOLiz7 nl5xBEMXwbkLZNiWWUIZI6cgFy9waPAR94w7Pv9beDx7stdfeyEZu0ocnNuUgHkn3pdj jBuQ== X-Gm-Message-State: AOJu0YykfnMVtaYSCzp+rhFG9UYnCva5zz3xHsHJ+X9LBSx/H1BjdVoP iICBpTZVL6dYpoLpOsFeAsZLjEyDqiA+MsFjAkBe+iBYCpSE/+M6NRNsHQ== X-Google-Smtp-Source: AGHT+IGl9ogI/RYfrS+5CRaM82W7lEyjPvhfTtPDA4azUVtrU1hrki3/r32lQmH5xA6UL6CMZxUIvQ== X-Received: by 2002:a17:907:20ee:b0:a68:9609:45ce with SMTP id a640c23a62f3a-a68960947f7mr82690566b.19.1717177566806; Fri, 31 May 2024 10:46:06 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57a31b9942esm1232158a12.12.2024.05.31.10.46.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2024 10:46:06 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_1A43E33F-06AB-490C-AAEF-B18C8A42354D" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2 Date: Fri, 31 May 2024 19:45:55 +0200 In-Reply-To: <734bb8e8-2fdf-4e50-9039-e53c99ee4930@app.fastmail.com> Cc: php internals To: Larry Garfield References: <0a6a61cd-f203-4dea-a7f8-97e6b885c52d@app.fastmail.com> <734bb8e8-2fdf-4e50-9039-e53c99ee4930@app.fastmail.com> X-Mailer: Apple Mail (2.3774.600.62) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_1A43E33F-06AB-490C-AAEF-B18C8A42354D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 31 mai 2024 =C3=A0 18:08, Larry Garfield a = =C3=A9crit : >=20 > However, this also brings up another interesting issue: readonly = properties (in 8.3) DO allow redeclaration, essentially adjusting the = property scope (the class that declares it) to make the visibility check = pass. That is, the definition of the class it is private to changes, = which is different from how inheritance works elsewhere. When the = parent writes to the same property, a special check is needed to verify = the two properties are related. All that special casing effectively = means that readonly in 8.4 wouldn't really be "write once + = private(set)", but "write once + private(set) - final", which is... just = kinda screwy. That means our options are: >=20 > * A BC break on readonly (not allowing it to be overridden) > * Make readonly an exception to the implicit final. > * Just don't allow readonly with aviz after all. Another possible option is: * Make readonly be `protected(set)` by default. That would weaken the originally intended semantics of readonly, but in = a compatible and acceptable way? =E2=80=94Claude --Apple-Mail=_1A43E33F-06AB-490C-AAEF-B18C8A42354D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Le 31 mai 2024 =C3=A0 18:08, Larry Garfield = <larry@garfieldtech.com> a =C3=A9crit :

However, this also brings up another = interesting issue: readonly properties (in 8.3) DO allow redeclaration, = essentially adjusting the property scope (the class that declares it) to = make the visibility check pass. That is, the definition of the class it = is private to changes, which is different from how inheritance works = elsewhere.  When the parent writes to the same property, a special = check is needed to verify the two properties are related.  All that = special casing effectively means that readonly in 8.4 wouldn't really be = "write once + private(set)", but "write once + private(set) - final", = which is... just kinda screwy.  That means our options = are:

* A BC break on readonly = (not allowing it to be overridden)
* Make = readonly an exception to the implicit final.
* Just don't allow readonly with aviz after = all.

Another possible option = is:

* Make readonly be `protected(set)` by = default.

That would weaken the originally = intended semantics of readonly, but in a compatible and acceptable = way?

=E2=80=94Claude

= --Apple-Mail=_1A43E33F-06AB-490C-AAEF-B18C8A42354D--