fixed 'Method ReflectionProperty::setAccessible() is deprecated since 8.5'#45
Open
shimooka wants to merge 4 commits intophpseclib:masterfrom
Open
fixed 'Method ReflectionProperty::setAccessible() is deprecated since 8.5'#45shimooka wants to merge 4 commits intophpseclib:masterfrom
shimooka wants to merge 4 commits intophpseclib:masterfrom
Conversation
terrafrost
requested changes
Apr 2, 2026
Member
terrafrost
left a comment
There was a problem hiding this comment.
Looks good! Just two small changes and we'll be good to go!
lib/mcrypt.php
Outdated
| $reflectionProperty = $reflectionObject->getProperty('key'); | ||
| $reflectionProperty->setAccessible(true); // can be dropped in PHP 8.1.0+ | ||
|
|
||
| if (version_compare(phpversion(), '8.1.0', '<')) { |
Member
There was a problem hiding this comment.
While that's technically valid, could you replace that with this?:
PHP_VERSION_ID < 80100
It's more consistent with how phpseclib v3 does things and it's marginally faster as well.
Thanks!
lib/mcrypt.php
Outdated
| $reflectionProperty->setAccessible(true); // can be dropped in PHP 8.1.0+ | ||
|
|
||
| if (version_compare(phpversion(), '8.1.0', '<')) { | ||
| $reflectionProperty->setAccessible(true); // can be dropped in PHP 8.1.0+ |
Member
There was a problem hiding this comment.
I guess we don't need that comment anymore now that we have that if statement!
shimooka
commented
Apr 3, 2026
Author
shimooka
left a comment
There was a problem hiding this comment.
I've applied your suggestions.
Thanks :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I fixed deprecation warning with PHP8.5.4 and mcrypt_compat 2.0.7 .
Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 /app/xdata/src/xd_webapp/alpha/vendor/phpseclib/mcrypt_compat/lib/mcrypt.php(796)