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

WordPress Trac noreply at wordpress.org
Tue Jul 25 22:43:16 UTC 2023


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

Comment (by hellofromTonya):

 When comparing how the code originally worked in 3.1 to how it worked in
 4.0 after adding the magic methods to option 2, here are the findings:

 1. For defined properties, the code works the same. No impacts.
 2. For dynamic properties:
    * The magic methods added in 4.0 caused a BC break when getting and
 setting.
    * Option 1 retains the current behavior (added in 4.0 with the magic
 methods).
    * Option 2 fixes the BC break and restores how it originally worked in
 3.1.

 Would Option 2 be considered a BC break for getting or setting dynamic
 properties?

 I'm inclined to say no. Though it will function differently than the
 current code for dynamic properties, the current code itself has been a BC
 break since first introduced in 4.0.

 On the other hand, one could argue that Option 2 is itself a BC break from
 the long standing behavior which could impact any extenders who are
 attempting to get or set a dynamic property. BC break of a BC break to
 restore the original behavior ;)

 Hmm, an interesting situation. Fix the long ago BC break (option 2). Or
 fix the immediate problem and retain current behavior (option 1).

 My mind next goes to knowing the impact by understanding how many plugins
 might be affected.

 Are any plugins using dynamic properties with `WP_List_Table`?

 There are over 3200 plugins using `WP_List_Table`
 https://wpdirectory.net/search/01H67HCY4CABR39QEEQRNH1DG8. It is possible
 there are plugins using dynamic properties. And if yes, then users using
 those plugins would be affected.

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


More information about the wp-trac mailing list