Re: [RFC] isReadable/isWriteable property reflection
| From: | Nicolas Grekas | Date: | Thu, 04 Dec 2025 14:18:15 +0000 |
| Subject: | Re: [RFC] isReadable/isWriteable property reflection | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129548@lists.php.net to get a copy of this message | ||
Sorry, typo:
I also think the auto-scope is a *not* good idea
Le jeu. 4 déc. 2025 à 15:05, Nicolas Grekas <nicolas.grekas+php@gmail.com>
a écrit :
>
> Le jeu. 6 nov. 2025 à 00:28, Larry Garfield <larry@garfieldtech.com> a
> écrit :
>
>> In other news, Ilija and I said a year ago that we'd take a swing at
>> adding isReadable/isWriteable methods to ReflectionProperty. Took a while,
>> but here we are. A strangely small RFC from us:
>>
>> https://wiki.php.net/rfc/isreadable-iswriteable
>>
>>
>
> Thanks for this.
> I also think the auto-scope is a good idea. You state that 90% of use
> cases will need this but my experience doesn't back this claim. The only
> cases where I had to check for read/writeable were out of the local scope,
> so I'd say 100% of my experience goes against that 90% number ;) Joke
> aside, it'd be just fine to let ppl be explicit. That's better than "oops I
> forgot to give the correct scope" bugs.
>
> About magic methods, one unsets a property only to have __get/__set
> called. Existing code works with this assumption. This means we have to
> return true IMHO. Magic methods are just generic hooks also. Which means
> they should behave the same.
>
> Nicolas
>