[wp-trac] [WordPress Trac] #49922: PHP Compatibility fixes for 5.5

WordPress Trac noreply at wordpress.org
Fri May 1 20:31:59 UTC 2020


#49922: PHP Compatibility fixes for 5.5
----------------------------+-------------------------------
 Reporter:  desrosj         |       Owner:  desrosj
     Type:  task (blessed)  |      Status:  assigned
 Priority:  normal          |   Milestone:  5.5
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  coding-standards
----------------------------+-------------------------------
Changes (by desrosj):

 * keywords:  has-patch needs-testing => has-patch


Comment:

 After [47735-47737], there are now only 33 warnings/errors remaining. They
 breakdown as follows:

 - 12 occurrences of `$HTTP_RAW_POST_DATA` (all in Core code) - see #49810.
 - 4 occurrences of `func_get_args()` - see ##47678.
 - 2 occurrences of `list()`: 1 in `wp-includes/capabilities.php` that
 needs to be very carefully reviewed, and one in getID3.
 - 2 occurrences of `php_errormsg` in `wp-includes/rss.php`.
 - 9 issues in PHPMailer. All but two will be fixed by the library update
 in #41750 (one `idn_to_ascii()` call and one occurrence of
 `mbstring.func_overload`).
 - 2 occurrences of `mbstring.func_overload`.
 - 1 occurrence of `debug_backtrace()` in `class-simplepie.php` that needs
 to be examined.
 - 1 occurrence of `dl()`.

 For the issues in the getID3 library, I decided to use inline comments to
 exclude the lines in question for a few reasons:
 - The library still supports PHP 5.3, so there are some snippets that the
 library must keep because of the conflicting support policies.
 - All of the issues flagged have fallbacks for more modern versions of
 PHP.
 - Some of the issues present are `if` statements informing developers that
 they shouldn't use something (which is good).

 I also though through the upgrade process for that library. Right now, it
 is wholesale copied over to core unmodified. The next time that this
 happens, the compatibility check job will be passing and removed from the
 `allowed_failures` list. The removal of the inline comments will cause the
 job to fail if they are not re-added. This is a good thing, in my opinion,
 as it prompts contributors to look at why. Each time that this happens, we
 can check the libraries support policy upstream and submit PRs to remove
 the code in question if appropriate.

 In [attachment:"49922.3.diff"]:
 - Ignore two occurrences of `mbstring.func_overload` in core
 functionality. Because this was not deprecated until PHP 7.2, these likely
 needs to remain for a bit.
 - Ignore an occurrence of `dl()`. This was not removed from PHP-FPM until
 7.0.0, so is a similar situation to `mbstring.func_overload`.

 I also wanted to note a great nice to have after the script is passing:
 the script should be added as a part of the `grunt precommit` command to
 help committers ensure they are not introducing compatibility issues
 before making commits.

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


More information about the wp-trac mailing list