Make WordPress Core

Opened 3 months ago

Last modified 7 days ago

#62622 new enhancement

Bump minimum PHP version to 7.3 or 7.4

Reported by: justlevine's profile justlevine Owned by:
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

This ticket tracks discussion and work on the next bump to the minimum PHP version (tentatively v7.3).

Policy / Criteria for Version Bumps

There is no official policy or criteria (ref) for handling PHP Version bumps. Pending that discussion, the following is based on the processes used until now:

  1. Matt is the ultimate decision maker on whether to bump the minimum PHP version.
  2. That discussion is initiated by the release/project leads based on several (public and private) factors.
  3. A general litmus test to gauge whether a version should be bumped is if the % of users (via https://wordpress.org/about/stats/) left behind by the bump is < 5%.
  4. However, usage stats alone are not reason to bump the minimum PHP Version but also have a positive impact on the project/codebase/tooling/etc.

Important: Bumping the minimum PHP version (this ticket) is not the same as changing the minimum ''recommended'' version (v7.4 as of 30 Nov 2024).

For the reasons above, the use of 7.3 in the title is really just to kickoff the discussion, and a decision may be made to wait/skip to v7.4.

Background: #58719, #51043, #57345

Data Points - Nov 2024

Hopefully, @samiamnot will continue his lovely periodic stat updates (last here), but as of 30 Nov 2024:

  • PHP 7.2 usage is 2.77% Including versions abandoned in the previous bump in WP6.6 (PHP 7.0-7.2): %4.59.
  • PHP 7.3 usage is 3.28%. (PHP 7.2 + 7.3 = 6.05%).
  • PHP 7.4 is at 32.83%. On WP6.6 Release Day, that number was `39.63%`.

Note: .org Stats do not offer a cross-reference between WP/PHP versions. As such these percentages include sites that may already be (colloquially) abandoned on a previous WordPress release,but could theoretically upgrade if their plugin/theme stack supports recent WP versions.

Bumping the minimum version to v7.3 would allow for

  • trailing commas in functions like sprintf() and array_merge()
  • removing back-compat for array_key_first(), array_key_last(), and is_countable()
  • possibly other things

Bumping the minimum version to v7.4 would allow for

  • unpacking inside arrays
  • arrow functions
  • typed properties (!!)
  • removing back-compat for hash_hmac() and hash_equals()
  • possibly other things

Previously

#58719 Bumping the minimum PHP version to 7.2 in WordPress 6.6
#57345 Bumping the minimum PHP version to 7.0 in WordPress 6.3
#46594 Bumping the minimum PHP version to 5.6 in WordPress 5.2
#16917 Bumping the minimum PHP version to 5.2 in WordPress 3.2

Change History (10)

#1 @masteradhoc
3 months ago

Thanks @justlevine for your work on this ticket and pushing further to get WP more into modern php versions. It would be great to get an early approve for this as it gives hosters, developers & webmasters an early headsup on whats going to be needed / possible for core, themes & plugins on the next WP Release.

To give a deeper insight here you can find a timeline with the recent drop - the pause in between - and a possible drop in the upcoming version.

WordPress Version Minimum PHP Version PHP EOL (of dropped version) since Date* Comment / PHP Version Number dropped
WP 6.6PHP 7.210 Jan 2019
1 Dec 2019
PHP 7.0 and PHP 7.1 Support was dropped
WP 6.7PHP 7.2- no change
WP 6.8PHP 7.330 Nov 2020 PHP 7.2 Support will be dropped

As the PHP 7.2 Usage seems way below the requested benchmark this could be the easiesr way to get an agreemeent on dropping this. The combined Usage of PHP 7.2/7.3 is still above the 5% threshold but could change until the release. I‘d still be in favor to drop both at the same time and inform everyone as early as possible. That way hosters maybe could already mass migrate a lot of their older WP-Sites. Happy to help here in the efforts to get this further.

An important comment in my view from @jrf about the big effort in maintaining WP running PHP cross-version see https://core.trac.wordpress.org/ticket/58719

To help maintainers here to get a proper solution i‘d support a version increase of php 7.2 & 7.3.

#2 @johnbillion
3 months ago

  • Summary changed from Bump minimum PHP version to 7.3 to Bump minimum PHP version to 7.3 or 7.4

My most recent opinion on this is that we'll be in a position to increase the minimum supported version of PHP to 7.4 in WordPress 6.9 in July 2025.

I've published some very roughly projected stats here which support this, with usage of 7.2 and 7.3 combined looking to drop below 5% around March 2025 and be close to 4% by July. Matt and Josepha have in the past been rightly concerned that bumping the minimum supported version too frequently means that in theory we could drop 15% of users across the three releases within a year, which is too much. One bump per year of 5% or less has worked well in recent years.

Last edited 3 months ago by johnbillion (previous) (diff)

#3 @samiamnot
3 months ago

Thanks @justlevine for the new ticket.

Updated for early Dec based on stats.

As we stand now, 5.2% of sites are on unsupported PHP versions, something that dropped 0.13% in the past month, vs 0.18% in the previous month.

7.2 + 7.3 are still dropping, but the rate slowed down this month from 0.26% last month to 0.21% this month. If this slowdown continues, @johnbillion's projection that would enable this ticket to proceed may not happen in time for v6.9.

Month/YearPHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 6.48 8.16 14.64%
Aug 2023 5.64 7.62 13.26%
Sep 2023 5.55 7.18 12.73%
Oct 2023 5.31 6.87 12.18%
Nov 2023 5.20 6.51 11.71%
Dec 2023 5.08 6.17 11.25%
Jan 2024 4.79 5.90 10.69%
Feb 2024 4.67 5.54 10.21%
Mar 2024 4.30 5.11 9.41%
Apr 2024 3.80 4.79 8.59%
May 2024 3.63 4.52 8.15%
Jun 2024 3.46 4.30 7.76%
Jul 2024 3.33 4.10 7.43%
Aug 2024 3.18 3.90 7.08%
Sep 2024 3.05 3.73 6.78%
Oct 2024 2.93 3.56 6.49%
Nov 2024 2.83 3.40 6.23%
Dec 2024 2.76 3.26 6.02%

For historical reasons, here are the stats for no longer supported versions (as of WP 6.6) going back to PHP 5.2. This is not changing much (going down about 0.20% a month) and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%
Jul 2024 0.19 0.44 0.35 0.30 2.63 1.36 0.86 6.13%
Aug 2024 0.19 0.43 0.34 0.29 2.53 1.31 0.82 5.91%
Sep 2024 0.19 0.41 0.33 0.28 2.45 1.25 0.79 5.70%
Oct 2024 0.18 0.40 0.32 0.27 2.38 1.20 0.76 5.51%
Nov 2024 0.18 0.39 0.31 0.26 2.32 1.15 0.72 5.33%
Dec 2024 0.17 0.39 0.31 0.26 2.27 1.11 0.69 5.20%

#4 @samiamnot
2 months ago

Updated for early Jan 2025 based on stats.

As we stand now, 5.06% of sites are on unsupported PHP versions, something that dropped 0.14% in the past month, vs 0.18% in the previous month.

7.2 + 7.3 that are slated to be dropped are still decreasing, but at a slower pace. This month from it was down 0.20%, vs 0.21 last month and 0.26% the previous month. Based on this slowdown, @johnbillion's projection that we could make the move in in v6.9 will likely be too early. I assume that by v7.0 we can make the move.

Month/YearPHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 6.48 8.16 14.64%
Aug 2023 5.64 7.62 13.26%
Sep 2023 5.55 7.18 12.73%
Oct 2023 5.31 6.87 12.18%
Nov 2023 5.20 6.51 11.71%
Dec 2023 5.08 6.17 11.25%
Jan 2024 4.79 5.90 10.69%
Feb 2024 4.67 5.54 10.21%
Mar 2024 4.30 5.11 9.41%
Apr 2024 3.80 4.79 8.59%
May 2024 3.63 4.52 8.15%
Jun 2024 3.46 4.30 7.76%
Jul 2024 3.33 4.10 7.43%
Aug 2024 3.18 3.90 7.08%
Sep 2024 3.05 3.73 6.78%
Oct 2024 2.93 3.56 6.49%
Nov 2024 2.83 3.40 6.23%
Dec 2024 2.76 3.26 6.02%
Jan 2025 2.68 3.14 5.82%

For historical reasons, here are the stats for no longer supported versions (as of WP 6.6) going back to PHP 5.2. This is not changing much (going down about 0.20% a month) and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%
Jul 2024 0.19 0.44 0.35 0.30 2.63 1.36 0.86 6.13%
Aug 2024 0.19 0.43 0.34 0.29 2.53 1.31 0.82 5.91%
Sep 2024 0.19 0.41 0.33 0.28 2.45 1.25 0.79 5.70%
Oct 2024 0.18 0.40 0.32 0.27 2.38 1.20 0.76 5.51%
Nov 2024 0.18 0.39 0.31 0.26 2.32 1.15 0.72 5.33%
Dec 2024 0.17 0.39 0.31 0.26 2.27 1.11 0.69 5.20%
Jan 2025 0.17 0.38 0.31 0.25 2.21 1.07 0.67 5.06%

#5 @samiamnot
5 weeks ago

Updated for early Feb 2025 based on WordPress stats.

For the first time in a while, the combined percentage of site on unsupported PHP versions has dropped below 5%. As we stand now, 4.96% of sites are on unsupported PHP versions, something that dropped 0.10% in the past month, vs 0.14% in the previous month.

7.2 + 7.3 that are slated to be dropped next, are still decreasing, but at a much slower pace. This month it was down 0.15%, vs 0.20 last month and 0.21% the previous month, and stands at 5.67%. Based on this slowdown, @johnbillion's projection that we could make the move in in v6.9 will likely be too early. I assume that by v7.0 we will have numbers low enough to consider making the move.

Month/YearPHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 6.48 8.16 14.64%
Aug 2023 5.64 7.62 13.26%
Sep 2023 5.55 7.18 12.73%
Oct 2023 5.31 6.87 12.18%
Nov 2023 5.20 6.51 11.71%
Dec 2023 5.08 6.17 11.25%
Jan 2024 4.79 5.90 10.69%
Feb 2024 4.67 5.54 10.21%
Mar 2024 4.30 5.11 9.41%
Apr 2024 3.80 4.79 8.59%
May 2024 3.63 4.52 8.15%
Jun 2024 3.46 4.30 7.76%
Jul 2024 3.33 4.10 7.43%
Aug 2024 3.18 3.90 7.08%
Sep 2024 3.05 3.73 6.78%
Oct 2024 2.93 3.56 6.49%
Nov 2024 2.83 3.40 6.23%
Dec 2024 2.76 3.26 6.02%
Jan 2025 2.68 3.14 5.82%
Feb 2025 2.63 3.04 5.67%

For historical reasons, here are the stats for no longer supported versions (as of WP 6.6) going back to PHP 5.2. This is not changing much (going down about 0.20% a month) and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%
Jul 2024 0.19 0.44 0.35 0.30 2.63 1.36 0.86 6.13%
Aug 2024 0.19 0.43 0.34 0.29 2.53 1.31 0.82 5.91%
Sep 2024 0.19 0.41 0.33 0.28 2.45 1.25 0.79 5.70%
Oct 2024 0.18 0.40 0.32 0.27 2.38 1.20 0.76 5.51%
Nov 2024 0.18 0.39 0.31 0.26 2.32 1.15 0.72 5.33%
Dec 2024 0.17 0.39 0.31 0.26 2.27 1.11 0.69 5.20%
Jan 2025 0.17 0.38 0.31 0.25 2.21 1.07 0.67 5.06%
Feb 2025 0.17 0.38 0.30 0.25 2.16 1.04 0.66 4.96%

#6 @johnbillion
5 weeks ago

I've tweaked my stats projection page to better account for the slowing decline in 7.2+7.3 sites.

#7 @masteradhoc
5 weeks ago

@johnbillion nice overview! Would it be possible to include PHP 8.4 as well? Would be interesting to see the progress there. But another topic :)

As we're currently at 5.67% for PHP 7.2 and PHP 7.3 i think it would be great to tell everyone and especially also hosts that it will be considered to deprecate it in v6.9. Then everyone gets enough time to prepare and the Release Leads could check with Matt to see his opinion on a drop for the versions that are already unsupported since many years.

#8 @johnbillion
5 weeks ago

I haven't bothered trying to project changes to usage of other versions because it's not a particularly accurate projection, it's intended really to give us an idea of when support for older versions can be dropped.

I'm going to wait until 6.8 is nearer release before speaking with Matt and Mary about this, but I will.

#9 @johnbillion
13 days ago

  • Milestone changed from Awaiting Review to 6.9

Moving this to 6.9 for visibility. This does not mean a decision has been made, and this still depends entirely on the usage numbers. It might get bumped to 7.0.

#10 @samiamnot
7 days ago

Updated for early Mar 2025 based on WordPress stats.

7.2 + 7.3 that are slated to be dropped next, are still decreasing, but slowly. This month it improved and was down 0.24%, vs 0.15% last month and 0.20% the previous month. It now stands at 5.43%. Based on this pace, @johnbillion's projection that we may be able to make the move in in v6.9 may still be possible, but I doubt that it will be likely (it may be low enough a month or two after the v6.8 release, but that may be too late).

As we stand now, 4.85% of sites are on unsupported PHP versions, something that dropped 0.11% in the past month, vs 0.10% in the previous month and 0.14% the month before that.

Month/YearPHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 6.48 8.16 14.64%
Aug 2023 5.64 7.62 13.26%
Sep 2023 5.55 7.18 12.73%
Oct 2023 5.31 6.87 12.18%
Nov 2023 5.20 6.51 11.71%
Dec 2023 5.08 6.17 11.25%
Jan 2024 4.79 5.90 10.69%
Feb 2024 4.67 5.54 10.21%
Mar 2024 4.30 5.11 9.41%
Apr 2024 3.80 4.79 8.59%
May 2024 3.63 4.52 8.15%
Jun 2024 3.46 4.30 7.76%
Jul 2024 3.33 4.10 7.43%
Aug 2024 3.18 3.90 7.08%
Sep 2024 3.05 3.73 6.78%
Oct 2024 2.93 3.56 6.49%
Nov 2024 2.83 3.40 6.23%
Dec 2024 2.76 3.26 6.02%
Jan 2025 2.68 3.14 5.82%
Feb 2025 2.63 3.04 5.67%
Mar 2025 2.50 2.93 5.43%

For historical reasons, here are the stats for no longer supported versions (as of WP 6.6) going back to PHP 5.2. This is not changing much (going down about 0.20% a month) and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%
Jul 2024 0.19 0.44 0.35 0.30 2.63 1.36 0.86 6.13%
Aug 2024 0.19 0.43 0.34 0.29 2.53 1.31 0.82 5.91%
Sep 2024 0.19 0.41 0.33 0.28 2.45 1.25 0.79 5.70%
Oct 2024 0.18 0.40 0.32 0.27 2.38 1.20 0.76 5.51%
Nov 2024 0.18 0.39 0.31 0.26 2.32 1.15 0.72 5.33%
Dec 2024 0.17 0.39 0.31 0.26 2.27 1.11 0.69 5.20%
Jan 2025 0.17 0.38 0.31 0.25 2.21 1.07 0.67 5.06%
Feb 2025 0.17 0.38 0.30 0.25 2.16 1.04 0.66 4.96%
Mar 2025 0.16 0.37 0.29 0.24 2.13 1.02 0.64 4.85%
Note: See TracTickets for help on using tickets.