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

WordPress Trac noreply at wordpress.org
Wed Aug 25 19:11:43 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.1
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php81 needs-dev-note has-patch       |     Focuses:
  early has-unit-tests commit fixed-major        |
-------------------------------------------------+-------------------------

Comment (by desrosj):

 Replying to [comment:38 jrf]:
 > This backport proposal means that plugins/themes can switch to using the
 new function name outright and that we greatly diminish the risk of
 burdening end-users with sites going down.

 I don't know that we can definitively say this. Because plugins and themes
 often support many versions of WordPress, we would need to backport this
 pretty far to be able to say this with any confidence.

 I think this situation is a parallel to when other new functions are added
 to Core. Plugin and theme developers need to use `function_exists()`
 checks to defensively confirm something exists before attempting to
 utilize it, or they must raise the minimum required version of WP. This is
 only different because this change is also related to PHP 8.1.

 While it would be nice to allow developers to start updating their code
 now, I think it's perfectly reasonable to call this out as a "preparing
 for WP 5.9 & PHP 8.1 support" item.

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


More information about the wp-trac mailing list