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
Last revisionBoth sides next revision
rfc:make-reflection-setaccessible-no-op [2021/06/13 16:34] – Added voting and put RFC under "in discussion" ocramiusrfc:make-reflection-setaccessible-no-op [2021/07/07 14:01] – Close vote - unanimous approval with 31 votes **for** this RFC to be adopted ocramius
Line 1: Line 1:
-====== PHP RFC: #[Deprecated] Attribute ======+====== PHP RFC: Make reflection setAccessible() no-op ======
  
   * Version: 1.0   * Version: 1.0
   * Date: 2021-06-13   * Date: 2021-06-13
   * Author: Marco Pivetta    * Author: Marco Pivetta 
-  * Status: Under Discussion+  * Status: Accepted
   * 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.txt · Last modified: 2021/07/08 08:57 by nikic