Make WordPress Core

#56790 closed task (blessed) (fixed)

PHP 8.x: various compatibility fixes for WordPress 6.2

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: General Keywords: php8 php81 php82 has-patch has-unit-tests
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 (7)

This ticket was mentioned in PR #3777 on WordPress/wordpress-develop by @bjorsch.


17 months ago
#1

  • Keywords has-patch has-unit-tests added

The IXR_Message class declares a property _currentTag, which is never assigned or used. It does assign to currentTag, which outside of that one assignment is never used either. A search on wpdirectory didn't turn up anything using either property (but lots of results for other classes having a property of the same name).

Since there are various other underscore-prefixed properties declared on the class, including one named _currentTagContents which is used in several places, it seems likely the declared property is correct and the assignment is a typo.

Trac ticket: https://core.trac.wordpress.org/ticket/56790

#2 @SergeyBiryukov
16 months ago

In 55105:

Code Modernization: Use correct property in IXR_Message::tag_open().

The IXR_Message class declares a property _currentTag, which is never assigned or used. It does assign to currentTag instead, which outside of that one assignment is never used either.

Since there are various other underscore-prefixed properties declared on the class, including one named _currentTagContents which is used in several places, it appears that the declared property is correct and the assignment is a typo.

This commit resolves a notice on PHP 8.2:

Deprecated: Creation of dynamic property IXR_Message::$currentTag is deprecated

Follow-up to [1346].

Props bjorsch, kraftbj, jrf, mukesh27, SergeyBiryukov.
See #56790.

#3 @SergeyBiryukov
16 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

@SergeyBiryukov commented on PR #3777:


16 months ago
#4

Thanks for the PR! Merged in r55105.

#5 @audrasjb
16 months ago

In 55214:

Fix a PHP 8 deprecation warning in category-template.php uasort() helper.

Props Webrocker, jigar-bhanushali, jrf, audrasjb, costdev.
Fixes #57358.
See #56790.

#6 @hellofromTonya
15 months ago

The last scheduled beta happened today. With RC1 happening next week and no open activity on this ticket, I'm closing this ticket. Thank you everyone for your contributions!

PHP 8+ compatibility work will continue in 6.3 cycle in #57837.

#7 @hellofromTonya
15 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.