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

From: Date: Sun, 13 Jun 2021 16:44:29 +0000
Subject: [RFC] make Reflection*#setAccessible() no-op
Groups: php.internals 
Request: Send a blank email to internals+get-114841@lists.php.net to get a copy of this message
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.

Greets,

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


Thread (6 messages)

« previous php.internals (#114841) next »