rfc:make-reflection-setaccessible-no-op

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:make-reflection-setaccessible-no-op [2021/06/13 16:36] – Fixed RFC title ocramiusrfc:make-reflection-setaccessible-no-op [2021/07/08 08:57] (current) nikic
Line 4: Line 4:
   * Date: 2021-06-13   * Date: 2021-06-13
   * Author: Marco Pivetta    * Author: Marco Pivetta 
-  * Status: Under Discussion+  * Status: Implemented (in PHP 8.1)
   * First Published at: https://wiki.php.net/rfc/make-reflection-setaccessible-no-op   * First Published at: https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
  
Line 78: Line 78:
   * make `ReflectionProperty` and `ReflectionMethod` behave as if `#setAccessible(true)` had been called upfront   * make `ReflectionProperty` and `ReflectionMethod` behave as if `#setAccessible(true)` had been called upfront
   * make `ReflectionProperty#setAccessible()` and `ReflectionMethod#setAccessible()` no-op operations, with no side-effects nor state mutation involved   * make `ReflectionProperty#setAccessible()` and `ReflectionMethod#setAccessible()` no-op operations, with no side-effects nor state mutation involved
 +
 +After the RFC is successfully accepted/implemented, the following code should no longer throw, improving therefore the ergonomics around reflection.
 +
 +<code php>
 +class Foo { private $bar = 'a'; }
 +
 +(new ReflectionProperty(Foo::class, 'bar'))->getValue();
 +</code>
 +
  
  
Line 133: Line 142:
 https://github.com/php/php-src/pull/5412 https://github.com/php/php-src/pull/5412
  
 +
 +===== Vote =====
 +
 +This is a Yes/No vote, requiring a 2/3 majority. Voting started on 2021-06-23 and ends on 2021-07-07.
 +
 +<doodle title="Make reflection setAccessible() no-op" auth="ocramius" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
rfc/make-reflection-setaccessible-no-op.1623602188.txt.gz · Last modified: 2021/06/13 16:36 by ocramius