[wp-trac] [WordPress Trac] #63061: Prepare for PHP 8.5
WordPress Trac
noreply at wordpress.org
Thu Aug 28 08:52:14 UTC 2025
#63061: Prepare for PHP 8.5
-----------------------------+--------------------------------
Reporter: johnbillion | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 6.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: php85 has-patch | Focuses: php-compatibility
-----------------------------+--------------------------------
Comment (by TobiasBg):
Several PHP functions that have not been doing anything since PHP 8.0/8.1
will be deprecated in PHP 8.5 and will thus be throwing warnings:
https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-
op_functions_from_the_resource_to_object_conversion
The quickest solution should be to only call them conditionally based on a
PHP version check, like
{{{
( PHP_VERSION_ID < 80100 ) && finfo_close();
( PHP_VERSION_ID < 80000 ) && xml_parser_free();
( PHP_VERSION_ID < 80000 ) && curl_close();
( PHP_VERSION_ID < 80000 ) && curl_share_close();
( PHP_VERSION_ID < 80000 ) && imagedestroy();
}}}
in places where they occur (some of which are in external or "originally-
external but now WP" libraries).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63061#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list