Re: [RFC] Asymmetric Visibility, with readonly
| From: | Tim Düsterhus | Date: | Tue, 22 Nov 2022 18:08:43 +0000 |
| Subject: | Re: [RFC] Asymmetric Visibility, with readonly | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119023@lists.php.net to get a copy of this message | ||
Hi
On 11/14/22 21:02, Claude Pache wrote:
To clarify my position: * The set visibility must be either more restrictive or of the same restriction level than the get visibility. * When the set visibility is absent, it is inferred as following:I agree with that. -------------- As I'm sending an email anyway: Larry, will there be a a new separate discussion thread, once all the problems are resolved and once it's clear what you propose? I just noticed the "Abbreviated Form" section in the RFC (https://wiki.php.net/rfc/asymmetric-visibility#abbreviated_form) which I disagree with, which apparently was added in October, but I remember an email letting readers know of the updated RFC. I didn't follow the evolution of the RFC too closely, though, because I believed that it still was in a somewhat early stage and because discussion is already split into way-to-many threads and also the poll. Best regards Tim Düsterhus* If* We don’t judge whether it is reasonable to writereadonlyis present, the set visibility isprivate(as of today); * otherwise, the set visibility is the same as the get visibility (again, as of today).protected protected(set) string $foo;when you could just writeprotected string $foofor the same effect. Similarly, we don’t judge whether it is reasonable to writepublic function()when you could just writefunction()for the same effect. We leave it to coding styles and linters to decide whether the short form or the long form is preferred.