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 marked this pull request as ready for review August 2, 2025 08:29
@WyriHaximus WyriHaximus added this to the v1.17.0 milestone Aug 13, 2025
@WyriHaximus
Copy link
Member

@W0rma Just filed #326 to solve the macos failure, can you rebase your PR once that PR has been merged?

@clue clue force-pushed the reflection-set-accessible branch from ac09dff to 68965d2 Compare October 19, 2025 20:08
Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@W0rma Thanks for the updates, changes LGTM! :shipit:

I've rebased your PR on current 1.x, all unrelated build errors have been fixed with #326 in the meantime, so time to move on finally! With these changes applied, tests against the current PHP 8.5 RC pass without errors (refs reactphp/dns#238 and clue/framework-x#282).

@clue clue changed the title [1.x] Do not call Reflection*::setAccessible() in PHP >= 8.1 [1.x] Improve PHP 8.5+ support by avoiding deprecated setAccessible() calls Oct 19, 2025
Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@WyriHaximus WyriHaximus merged commit def0730 into reactphp:1.x Oct 19, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants