WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#53160 new defect (bug)

PHP 7.4 map_deep compatibility issue

Reported by: xknown Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:

Description

PHP 7.4 Backward Incompatible Changes mention the following change of behavior.

Calling get_object_vars() on an ArrayObject instance will now always return the properties of the ArrayObject itself (or a subclass). Previously it returned the values of the wrapped array/object unless the ArrayObject::STD_PROP_LIST flag was specified.

Code that depend on map_deep and pass instances of ArrayObject to this function doesn't work the same way when running it with PHP 7.4. We detected this while migrating code from PHP 7.3 to 7.4:

See the following simple example:
https://3v4l.org/g3Xkj

Change History (1)

#1 @desrosj
5 months ago

  • Component changed from General to Formatting
Note: See TracTickets for help on using tickets.