Skip to content

Conversation

W0rma
Copy link
Contributor

@W0rma W0rma commented Aug 2, 2025

As of PHP 8.1.0, calling this method has no effect; all methods are invokable by default.

(https://www.php.net/manual/en/reflectionmethod.setaccessible.php and https://www.php.net/manual/en/reflectionproperty.setaccessible.php).

There're even plans to deprecate the method in PHP 8.5: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations

@W0rma W0rma force-pushed the reflection-set-accessible branch from ce48adb to 6edc0c7 Compare August 2, 2025 08:01
@W0rma W0rma force-pushed the reflection-set-accessible branch from 6edc0c7 to a86c4ef Compare August 2, 2025 08:06
@coveralls
Copy link

coveralls commented Aug 2, 2025

Coverage Status

coverage: 94.726% (+0.004%) from 94.722%
when pulling de15026 on W0rma:reflection-set-accessible
into f89c7d3 on PHP-CS-Fixer:master.

Co-authored-by: Gregor Harlan <mail@gh01.de>
@kubawerlos kubawerlos changed the title chore: Do not call Reflection*::setAccessible() in PHP >= 8.1 chore: do not call Reflection*::setAccessible() in PHP >= 8.1 Aug 2, 2025
@kubawerlos kubawerlos merged commit 9e141f5 into PHP-CS-Fixer:master Aug 2, 2025
31 checks passed
@kubawerlos
Copy link
Member

Thank you @W0rma

@W0rma W0rma deleted the reflection-set-accessible branch August 2, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants