Make WordPress Core

Opened 11 months ago

Last modified 8 weeks ago

#59654 new task (blessed)

PHP 8.x: various compatibility fixes for WordPress 6.7

Reported by: hellofromtonya's profile hellofromTonya Owned by:
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: General Keywords: php80 php81 php82 php83
Focuses: coding-standards Cc:

Description

Previously:

This ticket will be used as an "epic", allowing a variety of small patches each fixing a specific failure to be added to and committed against this ticket.

For patches addressing all instances of failures related to one specific PHP version (such as PHP 8.0, 8.1, or 8.2) change across the codebase, separate tickets should still be opened.

For an example of issues/patches with separate tickets, see:

  • #53299 PHP 8.1: Update is_serialized function to accept Enums
  • #53465 PHP 8.1.: the default value of the flags parameter for htmlentities() et all needs to be explicitly set

When opening a separate ticket, please tag it with the appropriate PHP version keyword so that these tickets can be easily found:

Change History (6)

This ticket was mentioned in Slack in #core by chaion07. View the logs.


7 months ago

#2 @swissspidy
7 months ago

  • Milestone changed from 6.5 to 6.6
  • Summary changed from PHP 8.x: various compatibility fixes for WordPress 6.5 to PHP 8.x: various compatibility fixes for WordPress 6.6

#3 @hellofromTonya
3 months ago

  • Milestone changed from 6.6 to 6.7
  • Summary changed from PHP 8.x: various compatibility fixes for WordPress 6.6 to PHP 8.x: various compatibility fixes for WordPress 6.7

Fixes for incompatibilities were committed during 6.6, but had their own tickets. Reassigning this ticket to 6.7.

#4 @jrf
8 weeks ago

PR GH 7039 fixes a newly introduced PHP 8.2 deprecation notice.

This was not caught by running the tests as this is a deprecation notice which is thrown at compile time, not runtime.

#5 @hellofromTonya
8 weeks ago

Patch: https://github.com/WordPress/wordpress-develop/pull/7039

Before this patch: the deprecation is thrown at the start of running the PHP 8.2+ tests ([see it here](https://github.com/WordPress/wordpress-develop/actions/runs/9957713967/job/27510405428#logs))

Not running external-http tests. To execute these, use --group external-http.

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.21

After this patch, the deprecation is no longer thrown ✅

Marking for and preparing the commit.

#6 @hellofromTonya
8 weeks ago

In 58733:

HTML API: Fix "${var} in strings" deprecation notice in html5lib test.

Changeset [58712] introduced the following compile time PHP deprecation notice on >= PHP 8.2 test runs:

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

The ${ syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.

Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

Follow-up to [58712].

Props jrf.
See #61530, #59654, #61576.

Note: See TracTickets for help on using tickets.