[wp-trac] [WordPress Trac] #53858: PHP 8.1: syntax error due to new 'readonly' property
WordPress Trac
noreply at wordpress.org
Mon Aug 2 11:42:29 UTC 2021
#53858: PHP 8.1: syntax error due to new 'readonly' property
-------------------------------+---------------------
Reporter: haosun | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.9
Component: General | Version: 4.9
Severity: normal | Resolution:
Keywords: needs-patch php81 | Focuses:
-------------------------------+---------------------
Comment (by knutsp):
> On PHP < 8.1, I suppose the reason to add this alias is to keep
consistent with other code, right?
Because some theme, plugin or site specific code in the wild might use the
(old) function when running PHP 5.6 - 8.0, it's needed not to cause a
fatal error. We can't expect those devs to write PHP 8.1 compatible code
in many, many years.
Btw: I wonder if just enclosing the function in an if statement is enough.
Maybe we have to include a file conditionally?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53858#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list