[wp-trac] [WordPress Trac] #53858: PHP 8.1: syntax error due to new 'readonly' property

WordPress Trac noreply at wordpress.org
Mon Aug 30 23:04:21 UTC 2021

#53858: PHP 8.1: syntax error due to new 'readonly' property
 Reporter:  haosun                               |       Owner:  jrf
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.8.2
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php81 needs-dev-note has-patch       |     Focuses:
  early has-unit-tests commit fixed-major        |

Comment (by jrf):

 Just FYI: I'm okay with not backporting this, as long as we all understand
 the risk sufficiently.

 Unlike other new Core functions, using a `function_exists()` and calling
 the old function if it doesn't exist, is not an option in this case, as
 just calling the old function alone will be a parse error in PHP 8.1.

 So without a backport, I'd strongly recommend for the code sample(s) I
 posted in https://core.trac.wordpress.org/ticket/53858#comment:13 to be
 used in the dev-note.

Ticket URL: <https://core.trac.wordpress.org/ticket/53858#comment:41>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list