#63956 closed defect (bug) (fixed)
PHP 8.5: `setAccessible` deprecations
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | php85 has-patch has-unit-tests |
| Focuses: | tests, php-compatibility | Cc: |
Description (last modified by )
Parent ticket for all things PHP 8.5: #63061
ReflectionProperty::setAccessible() and similar are deprecated since 8.5, as they have no effect since 8.1. See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
The solution is to call these functions only conditionally (e.g. if (\PHP_VERSION_ID < 80100) { $reflection->setAccessible(true); })
There are quite a few instances in core tests that we need to fix. See https://github.com/search?q=repo%3AWordPress%2Fwordpress-develop+setAccessible+language%3APHP&type=code&l=PHP
Change History (7)
This ticket was mentioned in PR #9847 on WordPress/wordpress-develop by @rishabhwp.
3 months ago
#4
- Keywords has-patch has-unit-tests added; needs-patch removed
Note: See
TracTickets for help on using
tickets.
I’d be happy to work on this and will submit a PR soon.