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

WordPress Trac noreply at wordpress.org
Mon Aug 2 17:20:53 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:  php81 needs-dev-note has-patch  |     Focuses:
--------------------------------------------+---------------------

Comment (by jrf):

 @ayeshrajans Thanks for the patch(es).

 In general looks good. A few small remarks:
 1. I can imagine it might help if the `@since` tag would still say `4.9.0`
 with a second `@since` tag stating that the function was renamed in 5.9.0
 and mentioning the old function name. I'm not 100% sure what the
 convention is for this (if there is one) as renaming functions is so rare
 in WP due to BC considerations.
 2. The `PHP_Compat` subdirectory name does not comply with the WP Coding
 Standards. This should be `php-compat` (lowercase and dash separated).

 I'll leave further opinions on the filename/subdirectory name to others.

 Are there any tests covering this method which need updating ? And if no:
 would now be a good time to add them ?

 @haosun Regarding the performance impact: fatal errors trump performance
 considerations any time. Including an extra file will always have a small
 performance impact, but can't be avoided in this case as we do need to
 mitigate the BC-break as much as possible.

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


More information about the wp-trac mailing list