#48074 closed task (blessed) (fixed)
Remove work-arounds for unsupported PHP versions
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | General | Keywords: | has-patch |
Focuses: | performance, coding-standards | Cc: |
Description
As support for PHP < 5.6.20 has been dropped, certain work-arounds which were in place to support older PHP versions can be removed.
The patches I'm attaching to this ticket are all fairly simple. I will add a more detailed description with each patch.
Attachments (10)
Change History (27)
@
5 years ago
Support for HHVM was dropped in 2017 via ticket #40548. This removes the one code work-around which I found which still checked for HHVM.
@
5 years ago
The IMAGETYPE_ICO
constant was itroduced in PHP 5.3, so no longer needs a work-around. See: https://www.php.net/manual/en/image.constants.php
@
5 years ago
The CURLOPT_PROTOCOLS
constant was introduced in PHP 5.2.10, so no longer needs a work-around. See: https://www.php.net/manual/en/function.curl-setopt.php
#1
@
5 years ago
@dkarfa Thanks for your enthousiasm.
Regarding patch 48074.4.patch
: this patch should not be committed as part of this ticket.
I left everything JSON out of this ticket on purpose as there is a separate ticket open for that and patches would too easily conflict otherwise.
See #47699
Patch 48074.6.patch
LGTM.
@
5 years ago
[src] Remove work-arounds for spl_object_hash() - The sp_object_hash()
function was introduced in PHP 5.2.0 and as of PHP 5.3, the PHP SPL extension can no longer be disabled, so these work-arounds are no longer needed. See: https://www.php.net/manual/en/function.spl-object-hash.php
@
5 years ago
The get_called_class()
function was introduced in PHP 5.3, so no longer needs a work-around. See: https://www.php.net/manual/en/function.get-called-class.php All instances were this method was called within the WP core codebase have been adjusted. Leaving the method in place for now as plugins/themes which use the WP unit test framework could still call this method.
@
5 years ago
The str_getcsv()
function was introduced in PHP 5.3.0, so no longer needs a polyfill. See: https://www.php.net/manual/en/function.str-getcsv.php
#2
@
5 years ago
FYI: passing build containing all the patches I uploaded for this ticket + #48705: https://travis-ci.org/jrfnl/wordpress-develop/builds/587153857
This patch removes all code using a
version_compare()
with a PHP version older than PHP 5.6.