Skip to content

Commit f7dbb24

Browse files
committed
General: Increase the minimum supported version of PHP to 7.0.0.
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account. Thank you for your service, PHP 5. Onwards! Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune Fixes #57345 git-svn-id: https://develop.svn.wordpress.org/trunk@56141 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 28fa6d1 commit f7dbb24

19 files changed

Lines changed: 13 additions & 1386 deletions

‎.github/workflows/phpunit-tests.yml‎

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ permissions: {}
3333
env:
3434
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
3535
LOCAL_PHP_MEMCACHED: ${{ false }}
36-
SLOW_TESTS: 'external-http,media,restapi'
3736

3837
jobs:
3938
# Runs the PHPUnit tests for WordPress.
@@ -56,7 +55,7 @@ jobs:
5655
# - Checks out the WordPress Test reporter repository.
5756
# - Submit the test results to the WordPress.org host test results.
5857
test-php:
59-
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
58+
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
6059
runs-on: ${{ matrix.os }}
6160
permissions:
6261
contents: read
@@ -65,23 +64,11 @@ jobs:
6564
strategy:
6665
fail-fast: false
6766
matrix:
68-
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
67+
php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
6968
os: [ ubuntu-latest ]
7069
memcached: [ false ]
71-
split_slow: [ false ]
7270
multisite: [ false, true ]
7371
include:
74-
# Additional "slow" jobs for PHP 5.6.
75-
- php: '5.6'
76-
os: ubuntu-latest
77-
memcached: false
78-
multisite: false
79-
split_slow: true
80-
- php: '5.6'
81-
os: ubuntu-latest
82-
memcached: false
83-
multisite: true
84-
split_slow: true
8572
# Include jobs for PHP 7.4 with memcached.
8673
- php: '7.4'
8774
os: ubuntu-latest
@@ -174,37 +161,22 @@ jobs:
174161
- name: Install WordPress
175162
run: npm run env:install
176163

177-
- name: Run slow PHPUnit tests
178-
if: ${{ matrix.split_slow }}
179-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
180-
181-
- name: Run PHPUnit tests for single site excluding slow tests
182-
if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }}
183-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required
184-
185-
- name: Run PHPUnit tests for Multisite excluding slow tests
186-
if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }}
187-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers
188-
189164
- name: Run PHPUnit tests
190-
if: ${{ matrix.php >= '7.0' }}
191165
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
192166

193167
- name: Run AJAX tests
194-
if: ${{ ! matrix.split_slow }}
195168
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
196169

197170
- name: Run ms-files tests as a multisite install
198-
if: ${{ matrix.multisite && ! matrix.split_slow }}
171+
if: ${{ matrix.multisite }}
199172
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
200173

201174
- name: Run external HTTP tests
202-
if: ${{ ! matrix.multisite && ! matrix.split_slow }}
175+
if: ${{ ! matrix.multisite }}
203176
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
204177

205178
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
206179
- name: Run (Xdebug) tests
207-
if: ${{ ! matrix.split_slow }}
208180
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
209181

210182
- name: Ensure version-controlled files are not modified or deleted

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"issues": "https://core.trac.wordpress.org/"
1111
},
1212
"require": {
13-
"php": ">=5.6"
13+
"php": ">=7.0"
1414
},
1515
"require-dev": {
1616
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",

‎phpcompat.xml.dist‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<rule ref="PHPCompatibilityWP"/>
66

7-
<!-- WordPress Core currently supports PHP 5.6+. -->
8-
<config name="testVersion" value="5.6-"/>
7+
<!-- WordPress Core currently supports PHP 7.0+. -->
8+
<config name="testVersion" value="7.0-"/>
99

1010
<!-- Only scan PHP files. -->
1111
<arg name="extensions" value="php"/>

‎src/readme.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h2>Migrating from other systems</h2>
5151

5252
<h2>System Requirements</h2>
5353
<ul>
54-
<li><a href="https://secure.php.net/">PHP</a> version <strong>5.6.20</strong> or greater.</li>
54+
<li><a href="https://secure.php.net/">PHP</a> version <strong>7.0</strong> or greater.</li>
5555
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.0</strong> or greater.</li>
5656
</ul>
5757

‎src/wp-includes/compat.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,6 @@ function hash_equals( $known_string, $user_string ) {
333333
}
334334
endif;
335335

336-
// random_int() was introduced in PHP 7.0.
337-
if ( ! function_exists( 'random_int' ) ) {
338-
require ABSPATH . WPINC . '/random_compat/random.php';
339-
}
340336
// sodium_crypto_box() was introduced in PHP 7.2.
341337
if ( ! function_exists( 'sodium_crypto_box' ) ) {
342338
require ABSPATH . WPINC . '/sodium_compat/autoload.php';

‎src/wp-includes/random_compat/byte_safe_strings.php‎

Lines changed: 0 additions & 195 deletions
This file was deleted.

‎src/wp-includes/random_compat/cast_to_int.php‎

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)