[policy] Default to requiring the latest stable PHP release available when a new major version reaches the first beta window

Created on 5 December 2023, 12 months ago
Updated 18 April 2024, 7 months ago

Problem/Motivation

For Drupal 10 we required PHP 8.1.

For Drupal 11 the current proposal is to require PHP 8.3 🌱 [11.x] [policy] Require PHP 8.3 for Drupal 11 RTBC .

Given we now have a predictable two-year release cycle and longer support for each major version, and PHP's release cycle is also predictable, we should be able to make our PHP requirements predictable in advance too.

There is one possible change to PHP's release cycle, that they'll add an extra year of security support for each release. https://wiki.php.net/rfc/release_cycle_update

Quoting @xjm:

We should set the minimum PHP requirement to the highest stable PHP version available at the time beta1 of the major is released. That means PHP 8.3 for D11.

We'll need the option to diverge from this in the case of a changed PHP release cycle or major version, but if we set this as a documented guideline it will save time deciding for Drupal 12 and onwards.

This puts us one PHP version ahead of Symfony's minimum, but we also release 6-12 months after Symfony major versions, so availability/support level for the respective releases should be similar.

There are two major advantages to this:

1. The PHP requirement for the new major release will be the same as the maximum supported PHP version for the previous major release (i.e. PHP 8.3 and Drupal 10/11), and if PHP core adds the extra year of security support, PHP 8.3 will be supported until Drupal 10's EOL. This makes PHP 8.3 the ideal 'bridge' version since Drupal 10 sites can stay secure on it even if they wait until the last minute to update to Drupal 11 and it should equally apply to future major releases.

2. Adopting the highest reasonable PHP version requirement insulates us against any of our dependencies dropping support for the previous one. This already happened when Symfony increased their minimum version to PHP 8.1 in a minor release, but fortunately before we'd already released Drupal 10: https://symfony.com/blog/symfony-6-1-will-require-php-8-1

The disadvantage: linux distributions and hosts may not fully offer the required PHP version, especially if we release in the earlier June window instead of the August or December windows. However, the more that other projects and hosts get used to PHP's annual release cycle, the earlier support is introduced each time - for example in December 2023, both platform.sh and pantheon.io already support PHP 8.3.

Steps to reproduce

Proposed resolution

A new policy doc in https://www.drupal.org/about/core/policies β†’ for this and the results of 🌱 [Policy] How to select the minimum required database versions Active , with a title about requirements.

PHP

The PHP requirements is set so that the latest Drupal version is as forward-compatible as possible.

This makes it easier to stay up to date with dependencies that release new minor or major versions that are only compatible with newer PHP versions.

Statement

  • The minimum PHP requirement is set to the highest stable PHP version available at the time beta1 of the next major version is released.
  • If a dependency is not sufficiently compatible with that PHP version by the time of beta1 of the next major versioΕ† then the earler verson of PHP may be used that for new major only.

Remaining tasks

Figure out where to document this.

User interface changes

API changes

Data model changes

Release notes snippet

🌱 Plan
Status

Needs review

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Needs release manager review

    It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.

  • Needs product manager review

    It is used to alert the product manager core committer(s) that an issue represents a significant new feature, UI change, or change to the "user experience" of Drupal, and their signoff is needed. If an issue significantly affects the usability of Drupal, use Needs usability review instead (see the governance policy draft for more information).

Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Plus one for this

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I support this change.

    I have added the text to be included in documentation. Right now, that is likely to be a new page about the release process that is intended for developers.

  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    Interesting, this links to https://wiki.php.net/rfc/release_cycle_update but that says it has a date of 2024-03-21. May be the date for the 2.0 version.

    Based on packagist data on PHP version usage, PHP 8.3 adoption was only 6.4% in January: https://stitcher.io/blog/php-version-stats-january-2024. While PHP 8.3 shot off much faster than 8.2 did, it still lags behind the speed of adoption of PHP 8.1 and that took more than a year to get to roughly 35% of adoption.

    I think we have our own struggles with getting people on new major versions, making it this much harder by requiring the bleeding edge version for a couple minor (feature) releases when there is no more features on the older major sounds quite ambitious.

    Am I reading the data wrong? I actually proposed πŸ“Œ Lower PHP requirement from 8.3 to 8.2 in Drupal 11 due to increased security support Closed: won't fix .

  • πŸ‡¬πŸ‡§United Kingdom catch

    I think the main group of sites that would benefit from lowering the requirement to PHP 8.2 are those sites that are already on PHP 8.2, because that completely decouples updating PHP and Drupal version for them.

    Sites that are on PHP 8.1 will still need to update PHP version to get onto Drupal 11, so if they have to go from 8.1 to 8.2 or 8.3, it's not going to make a huge difference probably.

    If we take this as 30% per https://stitcher.io/blog/php-version-stats-january-2024 that is quite a lot of sites, and comparing it to the PHP 8.1 stats, it could still be 30% at the end of the year (not the same sites/hosts, but because some people will update from PHP 8.1 to 8.2 to replace the hosts updating from PHP 8.2 to 8.3). Obviously these numbers don't correlate to Drupal installs, but since we don't have Drupal-specific data, it's probably the best we can do.

    My personal view is that an extra year of security support for PHP insulates us a bit more against #2 in the issue summary. I think #1 is about the same either way - i.e. sites can and should get onto PHP 8.3 on their Drupal 10 codebase, then go to Drupal 11.

  • πŸ‡ΊπŸ‡ΈUnited States xjm

    As per πŸ“Œ Lower PHP requirement from 8.3 to 8.2 in Drupal 11 due to increased security support Closed: won't fix , we will continue to require PHP 8.3 for Drupal 11 since we've already adopted PHP 8.3 syntaxes in some places.

    Per @catch, we can reconsider what we want to do for Drupal 12.

    My preference however remains that the latest Drupal version always be as forward-compatible as possible, since the previous Drupal version will be available for about two years with support for older PHP versions. This helps us when dependencies release new minor or major versions that are only compatible with newer PHP versions.

    Conversely, if one of our dependencies wasn't sufficiently compatible with the PHP version by a time when no other blockers remained to a major release beta, I'd go with the older version for that major only.

  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States xjm
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Updated the proposed text with a more complete suggestion, taking into account #7

  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    I also don't really see any real big problems here. Most hosting providers I've come across are quick to adopt newer PHP versions. Maybe the slower ones to adapt are the shared FTP "kind" of hosting, long time since I've used one of those so can't tell for sure.

    Nice to see the boost in performance as well! Quite a big difference there.

Production build 0.71.5 2024