Re: [RFC] make Reflection*#setAccessible() no-op

From: Date: Sun, 13 Jun 2021 18:46:12 +0000
Subject: Re: [RFC] make Reflection*#setAccessible() no-op
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-114843@lists.php.net to get a copy of this message
On Sun, Jun 13, 2021, at 11:44 AM, Marco Pivetta wrote:
> Hey folks,
> 
> I'm posting here to introduce a new simplification, as well as
> quality-of-life-improving RFC:
> 
> https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
> 
> The RFC is quite minimal, and proposes removing any runtime behavior from
> ReflectionMethod#setAccessible() and
> ReflectionProperty#setAccessible(), making ReflectionMethod and
> ReflectionProperty accessible by default.
> 
> The rationale is:
> 
>  * this API is probably coming from a copy-pasted java-ism (although I
> couldn't verify that, so I did not factor it into the RFC)
>  * removes the last bit of mutable state from ReflectionProperty and
> ReflectionMethod
>  * simplifies usage of the API
>  * if I'm up to no good, I don't need to actually solemnly swear that i am
> up to no good (that's stuff for fantasy books)
> 
> I don't really know what the deadline for 8.1 features is, but I assume
> it's coming up quite quickly, so friendly NikiC poked me to see if this
> long-standing patch of mine was still relevant.
> 
> Should be short/sweet, but I'm looking forward to your feedback.

I'm generally OK with it.  The change makes sense.

What I'm unclear on is why it's not including the actual deprecation.  Not doing that yet
and having it just become a noop first seems fine, but it's also clear that having it throw a
deprecation in the future, and presumably then having those methods be removed outright, is the
long-term plan.  I'm good with that too, but I don't see why the full death-cycle
isn't included, and half of it is instead punted to a future RFC.

Please explain.

--Larry Garfield


Thread (6 messages)

« previous php.internals (#114843) next »