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

- Thread: https://externals.io/message/115068
- Original archive: https://news-web.php.net/php.internals/115068
- Started by Marco Pivetta on 2021-06-23T15:09:41+00:00
- Messages: 5
- RFC: Make reflection setAccessible() no-op (Implemented (PHP 8.1)) — https://externals.io/rfc/make-reflection-setaccessible-no-op.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #115068 — Marco Pivetta — 2021-06-23T15:09:41+00:00

URL: https://externals.io/message/115068#115068

Hey folks,

I'm opening the vote for making `Reflection*#setAccessible()`.


Voting starts today (2021-06-23) and ends in 14 days (2021-07-07).

Vote at https://wiki.php.net/rfc/make-reflection-setaccessible-no-op

Discussion: https://marc.info/?l=php-internals&m=162360269505048&w=2

Discussion^2: https://externals.io/message/114841

Meanwhile, if anybody knows why the RFC isn't listed on `/rfc`, lemme know
:D

Greets,

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

---

## #115069 — Guilliam Xavier — 2021-06-23T15:49:37+00:00

URL: https://externals.io/message/115068#115069 · In reply to: #115068

Meanwhile, if anybody knows why the RFC isn't listed on `/rfc`, lemme know
> :D
>

You have to add it manually, cf https://wiki.php.net/rfc/howto 3.4
(yeah...)

Cheers

-- 
Guilliam Xavier

---

## #115070 — Marco Pivetta — 2021-06-23T15:54:21+00:00

URL: https://externals.io/message/115068#115070 · In reply to: #115069

On Wed, Jun 23, 2021 at 5:49 PM Guilliam Xavier <guilliam.xavier@gmail.com>
wrote:

>
> Meanwhile, if anybody knows why the RFC isn't listed on `/rfc`, lemme know
> > […]
>
> You have to add it manually, cf https://wiki.php.net/rfc/howto 3.4
> (yeah...)
>

Excellent, thanks :-D

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

---

## #115084 — tyson andre — 2021-06-23T23:20:26+00:00

URL: https://externals.io/message/115068#115084 · In reply to: #115068

Mi Marco Pivetta,

> I'm opening the vote for making `Reflection*#setAccessible()`.
> 
> Voting starts today (2021-06-23) and ends in 14 days (2021-07-07).
> 
> Vote at https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
> 
> Discussion: https://marc.info/?l=php-internals&m=162360269505048&w=2
> 
> Discussion^2: https://externals.io/message/114841

I'm in favor of this even without adding isAccessible(),
but just to note:

https://wiki.php.net/rfc/howto mentions:

> Listen to the feedback, and try to answer/resolve all questions.
> **Update your RFC to document all the issues and discussions.
> Cover both the positive and negative arguments.** Put the RFC URL into all your replies.

1. This should probably link to the RFC discussions in a References section,
   not everyone who votes reads the mailing list.
2. https://externals.io/message/114841#114845  is the only thing that resembled an objection for a "Discussion" 
   section or future scope, though

   > I think that isAccessible should be added if any applications actually did depend on ReflectionException
   > being thrown for correctness - they could throw their own exception if isAccessible was false.
   > (e.g. for code meant to handle possibly undefined public typed properties by checking for initialization
   > then getting the value)
   >
   > I can't actually remember needing this (anything other than setAccessible(true)) personally, though, since `$obj->{$method}(...$args)` could be used.
   > I've only used this to access private and protected properties/methods.

Thanks,
Tyson

---

## #115351 — Marco Pivetta — 2021-07-07T14:00:11+00:00

URL: https://externals.io/message/115068#115351 · In reply to: #115084

Hey y'all,

I'm closing the vote for making `Reflection*#setAccessible()` no-op.

The result is a unanimous 31 votes **for** the change to be included in PHP
8.1: I will clean up https://github.com/php/php-src/pull/5412 and get it
ready for merge :-)

@Tyson sorry, I really forgot to update the RFC with any further feedback
there, and only checked again today as per a calendar entry I created for
this.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On Thu, Jun 24, 2021 at 1:20 AM tyson andre <tysonandre775@hotmail.com>
wrote:

> Mi Marco Pivetta,
>
> > […]
>
> I'm in favor of this even without adding isAccessible(),
> but just to note:
>
> https://wiki.php.net/rfc/howto mentions:
>
> > […]
> all your replies.
>
> 1. This should probably link to the RFC discussions in a References
> section,
>    not everyone who votes reads the mailing list.
> 2. https://externals.io/message/114841#114845  is the only thing that
> resembled an objection for a "Discussion"
>    section or future scope, though
>
> > […]
> actually did depend on ReflectionException
> > […]
> if isAccessible was false.
> > […]
> properties by checking for initialization
> > […]
> setAccessible(true)) personally, though, since `$obj->{$method}(...$args)`
> could be used.
> > […]
> properties/methods.
>
> Thanks,
> Tyson
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php
