[wp-trac] [WordPress Trac] #58896: Fix WP_List_Table magic methods for PHP 8.2 dynamic properties

WordPress Trac noreply at wordpress.org
Thu Aug 3 15:49:32 UTC 2023


#58896: Fix WP_List_Table magic methods for PHP 8.2 dynamic properties
-------------------------------------------------+-------------------------
 Reporter:  antonvlasenko                        |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.4
Component:  Administration                       |     Version:  4.0
 Severity:  normal                               |  Resolution:
 Keywords:  php82 has-unit-tests commit needs-   |     Focuses:  php-
  patch                                          |  compatibility
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  php82 has-patch has-unit-tests commit => php82 has-unit-tests
     commit needs-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Reopening to improve the deprecation message. I think the word "define"
 should be changed to "declare".

 Why is "declare" better?
 It aligns well to the topic of dynamic properties and the act of
 explicitly listing the variable as a property on the class.

 The goal of this message is guide developers to change their code.
 Changing the term to "declare" hopefully will aid in the understanding of
 what is being asked of developers when this deprecation is thrown.

 For example, if the developer does "dynamic properties" search, they'll
 likely be lead to these resources:

 * The [https://wiki.php.net/rfc/deprecate_dynamic_properties RFC for
 deprecating dynamic properties], which defines a dynamic property in PHP
 as:

 >“Dynamic property” here refers to a property that has not been declared
 in the class.

 * [https://php.watch/versions/8.2/dynamic-properties-deprecated
 php.watch's explanation of the dynamic properties deprecation].

 It's also worth noting that both terms are used in the
 [https://www.php.net/manual/en/language.oop5.properties.php PHP manual's
 OOP Property page].

 I'll follow-up with PR and commit shortly.

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


More information about the wp-trac mailing list