Make WordPress Core


Ignore:
Timestamp:
09/11/2025 02:45:56 PM (7 months ago)
Author:
swissspidy
Message:

Code Modernization: Address reflection no-op function deprecations in PHP 8.5.

Reflection*::setAccessible() methods are no-ops since PHP 8.1. This commit adds conditional checks to only call these functions on older PHP versions.

Reference: PHP RFC: Deprecations for PHP 8.5: Deprecate `Reflection*::setAccessible()`.

Props rishabhwp, swissspidy.
Fixes #63956.
See #63061.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/wpAutomaticUpdater.php

    r56971 r60729  
    3131
    3232        self::$send_plugin_theme_email = new ReflectionMethod( self::$updater, 'send_plugin_theme_email' );
    33         self::$send_plugin_theme_email->setAccessible( true );
     33        if ( PHP_VERSION_ID < 80100 ) {
     34            self::$send_plugin_theme_email->setAccessible( true );
     35        }
    3436    }
    3537
Note: See TracChangeset for help on using the changeset viewer.