Skip to content

Comments

Do not call Reflection*::setAccessible() in PHP >= 8.1#115

Merged
goetas merged 1 commit intoschmittjoh:masterfrom
W0rma:reflection-set-accessible
Aug 1, 2025
Merged

Do not call Reflection*::setAccessible() in PHP >= 8.1#115
goetas merged 1 commit intoschmittjoh:masterfrom
W0rma:reflection-set-accessible

Conversation

@W0rma
Copy link
Contributor

@W0rma W0rma commented Aug 1, 2025

Q A
Bug fix? no
New feature? no
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT

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
Copy link
Contributor Author

W0rma commented Aug 1, 2025

I created #116 to fix the CI

@goetas goetas merged commit 1b17445 into schmittjoh:master Aug 1, 2025
0 of 13 checks passed
@W0rma W0rma deleted the reflection-set-accessible branch August 1, 2025 11:10
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.

2 participants