#63061 closed task (blessed) (fixed)
Prepare for PHP 8.5
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | php85 has-patch has-dev-note |
| Focuses: | php-compatibility | Cc: |
Description (last modified by )
This is the meta or "epic" ticket that encapsulates PHP 8.5 compatibility.
Previously:
We're going to try a different approach this time around. All tasks relating to PHP 8.5 compatibility (including devops tasks) will be detailed in and handled in individual tickets. This ticket will remain only in the target milestone for tracking purposes. General info about PHP 8.5 can be added to the summary, and tickets for the actual tasks will be created separately and then linked here.
The previous epic tickets served us really well in the early stages of the corresponding release, but subsequently made it extremely difficult to determine the status of any given change, whether it shipped in any given version, and what is required for compatibility without having to read through the entire ticket. Splitting every required task into a separate ticket with its own acceptance criteria and milestone will help greatly in this regard.
General info
PHP 8.5 is scheduled for release in November 2025. Beta can be expected in August and RC around the end of September.
Tickets
Attachments (1)
Change History (40)
This ticket was mentioned in PR #9592 on WordPress/wordpress-develop by @TobiasBg.
5 months ago
#4
- Keywords has-patch added
PHP 8.5 deprecates non-canonical scalar type casts (boolean|double|integer|binary). Therefore, their canonical versions should be used.
See https://php.watch/versions/8.5/boolean-double-integer-binary-casts-deprecated.
The changes in this commit are the only non-canonical scalar type cases in Core files that are maintained directly.
Another occurrence has been submitted for getID3 upstream.
This PR is handled as part of https://core.trac.wordpress.org/ticket/63061.
@SergeyBiryukov commented on PR #9592:
5 months ago
#7
Thanks for the PR! Merged in r60659.
This ticket was mentioned in PR #9605 on WordPress/wordpress-develop by @vidugupta.
5 months ago
#8
PHP 8.5 deprecates four alternative scalar type names in favor of their canonical names:
- boolean → bool
- double → float
- integer → int
- binary → string
This PR replaces deprecated casts in the bundled JSON, IXR, and ID3 libraries to ensure forward compatibility and avoid deprecation notices.
Follow-up to [60659].
See Trac: https://core.trac.wordpress.org/ticket/63061
This ticket was mentioned in Slack in #core by vidugupta. View the logs.
5 months ago
@SergeyBiryukov commented on PR #9605:
5 months ago
#10
Hi there, thanks for the PR!
Please note that getID3 is an external library, and there is already a PR available upstream: JamesHeinrich/getID3#469.
#12
@
5 months ago
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).
#13
@
4 months ago
I attached a patch that wraps all calls to the mentioned deprecated PHP functions in a PHP version check.
Externally maintained libraries are not included, instead I opened a PR upstream:
SimplePie: https://github.com/simplepie/simplepie/pull/937
Requests: https://github.com/WordPress/Requests/pull/947
#17
@
4 months ago
SimplePie 1.9.0 with the mentioned PR has been released, see #63961.
#18
@
4 months ago
Another sub-ticket: #63962
(PHP 8.5: Fix deprecation notices for sleep and wakeup magic methods)
This ticket was mentioned in PR #9845 on WordPress/wordpress-develop by @swissspidy.
4 months ago
#22
Trac ticket: https://core.trac.wordpress.org/ticket/63061
@swissspidy commented on PR #9845:
4 months ago
#27
This is very close. A new issue popped up in SimplePie (https://github.com/simplepie/simplepie/pull/949) but otherwise tests all pass without failures and errors.
#29
@
3 months ago
- Keywords needs-dev-note added
Is there anything left outstanding for this one? If everything has been addressed, we should prepare a dev note detailing the changes in 8.5 and how they impact WordPress Core, plugin/theme developers, etc.
#31
@
2 months ago
With tests passing and no known issues remaining, I think the devnote and updating the PHP Compatibility and WordPress Versions page is all the is necessary to declare beta support in 6.9.
This ticket was mentioned in Slack in #core by welcher. View the logs.
2 months ago
This ticket was mentioned in PR #10498 on WordPress/wordpress-develop by @westonruter.
2 months ago
#33
This avoids a deprecation warning in PHP 8.5:
Using null as an array offset is deprecated, use an empty string instead /var/www/src/wp-includes/class-wp-date-query.php:516 /var/www/src/wp-includes/class-wp-date-query.php:170 /var/www/src/wp-includes/class-wp-query.php:2138 /var/www/src/wp-includes/class-wp-query.php:3958 /var/www/src/wp-includes/class-wp.php:704 /var/www/src/wp-includes/class-wp.php:824 /var/www/tests/phpunit/includes/abstract-testcase.php:1346 /var/www/tests/phpunit/includes/testcase-canonical.php:303 /var/www/tests/phpunit/tests/canonical.php:68 /var/www/vendor/bin/phpunit:122
Specifically, the issue is that $wpdb->blogs is null when not on a single-site install. So this ensures that the $wpdb->blogs column is only added to the $known_columns array when on multisite.
It also updates the $valid_columns array to only include multisite-related columns when on multisite, namely registered and last_updated.
Lastly, the phpdoc @var tags for $wpdb->blogs, $wpdb->blogmeta, and the other multisite-specific tables have been updated to indicate they may be null.
Trac ticket: https://core.trac.wordpress.org/ticket/63061
@westonruter commented on PR #10498:
2 months ago
#34
Added a few small nits. I don't think it's in the coding standards, but I prefer to have an empty line before a control structures.
Cool. I'll apply when committing.
@desrosj commented on PR #10498:
2 months ago
#35
I changed the PR description to point to Core-63957 since that's the more specific issue being addressed here.
#37
@
2 months ago
- Resolution set to fixed
- Status changed from new to closed
With RC1 in ~12 hours and no outstanding known issues, I am going to close this one out as fixed.
If someone would be able and willing to draft a developer note, that would be amazing. If not, I will do my best to get one published this week.
#38
@
2 months ago
- Draft make/core post. Let's publish it on November 20th once PHP 8.5 is released.
- Draft revision to the PHP Compatibility and WordPress Versions page. Can be published on December 2nd once WordPress 6.9 is released.
#39
@
8 weeks ago
- Keywords has-dev-note added; needs-dev-note removed
Dev note published: https://make.wordpress.org/core/2025/11/21/php-8-5-support-in-wordpress-6-9/
PHP 8.5 deprecates non-canonical scalar type casts (boolean|double|integer|binary) deprecated.
In the Core codebase, I found these in 3 separate files, all from external libraries.
For the getID3 library, I created a PR upstream.
Two more occurrences are in the IXR and JSON libraries, which are unmaintained and therefore can be updated directly in Core, for which I created this PR:
https://github.com/WordPress/wordpress-develop/pull/9592