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

WordPress Trac noreply at wordpress.org
Mon Aug 2 06:04:41 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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 New 'readonly' property modifier is introduced to PHP 8.1 after commit
 6780aaa5[1]. That means, 'readonly' becomes one keyword.

 However, there is a function named 'readonly' in wordpress, which would
 lead to a syntax error, as shown in the following error message:

   Parse error: syntax error, unexpected token "readonly", expecting "(" in
 /var/www/html/php-bench/wordpress/wp-includes/general-template.php on line
 4823

 [1] https://github.com/php/php-src/commit/6780aaa5

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


More information about the wp-trac mailing list