Re: Asymmetric visibility is a BC break
| From: | Valentin Udaltsov | Date: | Thu, 10 Oct 2024 13:22:30 +0000 |
| Subject: | Re: Asymmetric visibility is a BC break | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125778@lists.php.net to get a copy of this message | ||
On 09.10.2024 19:08, Kamil Tekiela <tekiela246@gmail.com> wrote:
>
> I have to admit I understood nothing from your email, but I got
> curious about some of your words.
Hi, Kamil! I tried my best :) Thank you for your interest!
> > A readonly property is two functionalities in one: write-once and
> private set.
>
> What do you mean it is private set? Readonly only means the property
> is writable once. It does not affect its visibility.
It in fact does affect visibility. For instance, you cannot write
uninitialized public property from global scope:
https://3v4l.org/4Xf2R
The same fact is mentioned in the aviz RFC:
https://wiki.php.net/rfc/asymmetric-visibility-v2#:~:text=The%20readonly%20flag%2C%20introduced%20in%20PHP%208.1%2C%20is%20really%20two%20flags%20in%20one
--
Valentin