[wp-trac] [WordPress Trac] #55257: map_deep() function incompatibility with incomplete objects in PHP 8.0+
WordPress Trac
noreply at wordpress.org
Tue Feb 28 02:48:16 UTC 2023
#55257: map_deep() function incompatibility with incomplete objects in PHP 8.0+
-------------------------------------------------+-------------------------
Reporter: codex-m | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.2
Component: Formatting | Version: 5.9.1
Severity: major | Resolution:
Keywords: has-patch php8 has-unit-tests 2nd- | Focuses:
opinion |
-------------------------------------------------+-------------------------
Comment (by costdev):
According to [https://www.php.net/manual/en/migration80.incompatible.php
PHP 7.4.x - 8.0.x - Backward Incompatible changes], some warnings and
notices got a bump in error level in PHP 8.0, including, for example:
Attempting to write to a property of a non-object. Previously this
implicitly created an stdClass object for null, false and empty strings.
-----
The issue reported in this ticket was previously a Notice,
[https://3v4l.org/WJiN0 as shown here].
Since this Notice, and now Fatal Error, are there to tell you that the
class is not defined, I'm not totally sure what the aim of preventing the
Fatal Error is.
Sure, it would prevent execution being halted, but it would also
perpetuate acting on an object of an undefined class.
So, is there a valid use case for this? For example, a setting whose value
includes an object of a class defined in a plugin that's no longer active?
Also pinging @audrasjb and @hellofromTonya as 6.2 Core Tech Leads, as the
patch seems close to `commit`-ready if this change is desired.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55257#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list