[wp-trac] [WordPress Trac] #53160: PHP 7.4 map_deep compatibility issue

WordPress Trac noreply at wordpress.org
Wed May 5 12:34:50 UTC 2021


#53160: PHP 7.4 map_deep compatibility issue
--------------------------+-----------------------------
 Reporter:  xknown        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 [https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.spl
 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53160>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list