Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#53160 new defect (bug)

PHP 7.4 map_deep compatibility issue

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


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:

Change History (1)

#1 @desrosj
3 years ago

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