Changes between Initial Version and Version 1 of Ticket #53858, comment 12
- Timestamp:
- 08/02/2021 11:48:32 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #53858, comment 12
initial v1 5 5 I've read through the discussion so far and would like to add some observations: 6 6 1. This function ''is'' used in - at least in userland code -, though luckily not very often. Here is a [https://wpdirectory.net/search/01FC39KK20BEK3V06X1PSBDQJV WP Directory plugin search] showing this. Lots of false positives for JS code, but also some real uses and even polyfill declarations for when WP didn't have the function yet. A [https://wpdirectory.net/search/01FC3A2BFQARC0EMYY2CAYGTBF Theme Search for the same] did not yield any valid results. 7 2. While this will be even more difficult to search for, the function ''may'' also be used as a callback via `add_filter()`. To be honest, I wouldn't be surprised if that type of use exists in the WP Core codebase, though I haven't done a search for it (yet). In that case, in PHP 8.1, I expect this will result in a run-time fatal error when `readonly` gets called via `apply_filters()`. This type of use definitely also [https://wpdirectory.net/search/01FC3AQG97EF12JQ1M2H6RSWD1 exists in plugins], like can be seen in the "Booster for WooCommerce" plugin.7 2. While this will be even more difficult to search for, the function ''may'' also be used as a callback via `add_filter()`. To be honest, I wouldn't be surprised if that type of use exists in the WP Core codebase, though I haven't done a search for it (yet). In that case, in PHP 8.1, I expect this will result in a run-time fatal error when `readonly` gets called via `apply_filters()`. 8 8 3. A plain renaming of the function is a BC-break which is unacceptable in the WP landscape as it **will** break integrations. 9 9 4. Aliasing the function in the manner @swissspidy suggest in `wp-includes/deprecated.php` will not work as `readonly` will now be full keyword in PHP, which means that loading the file with the original deprecated function would yield a parse error in PHP 8.1, i.e. result in a white screen of death.