[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 20:40: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):
== How did the original 3.1 code work?
Before the magic methods were added, how did the original `WP_List_Table`
work with defined and undefined (dynamic) properties? This test report
shows it in action, i.e. to set a baseline for considering how to fix this
ticket.
== Running on PHP 5.2.17
Demo: https://3v4l.org/GBfpi#v5.2.17 using the properties code from WP 3.1
in [15491] / #14579.
* Get:
* Defined property: returns `NULL`
* Dynamic property: returns `NULL` and throws `Notice`
* `isset()`:
* Defined property: `false`
* Dynamic property: `false`
* Set:
* Defined property: sets it
* Dynamic property: sets it
* After an `unset()`
* Get:
* Defined property: returns `NULL` and throws a `Notice`
* Dynamic property: returns `NULL` and throws a `Notice`
* `isset()`:
* Defined property: returns `false`
* Dynamic property: returns `false`
* Set:
* Defined property: sets it
* Dynamic property: sets it
* `isset()`:
* Defined property: returns `true`
* Dynamic property: returns `true`
== Running on PHP 8.1.20
Demo: https://3v4l.org/GBfpi#v8.1.20 using the properties code from WP 3.1
in [15491] / #14579.
* Get:
* Defined property: `null`
* Dynamic property: returns `NULL` and throws `Warning`
* `isset()`:
* Defined property: `false`
* Dynamic property: `false`
* Set:
* Defined property: sets it
* Dynamic property: sets it
* After an `unset()`
* Get:
* Defined property: returns `NULL` and throws a `Warning`
* Dynamic property: returns `NULL` and throws a `Warning`
* `isset()`:
* Defined property: returns `false`
* Dynamic property: returns `false`
* Set:
* Defined property: sets it
* Dynamic property: sets it
* `isset()`:
* Defined property: returns `true`
* Dynamic property: returns `true`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58896#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list