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

WordPress Trac noreply at wordpress.org
Mon Aug 2 07:21:33 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:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by knutsp):

 Hello @haosun and welcome to Trac!

 Nice find. Nasty thing.

 Would this work?

 1. Rename `readonly()` to `wp_readonly()`
 2. If PHP<8.1 : `function readonly()` calls `wp_readonly()`

 This function has "friends", like `checked()`. Also alias them for some
 consistency?

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


More information about the wp-trac mailing list