Problem/Motivation

Once we support PHP 8.5 fully and the 12.x branch is open, we can require PHP 8.5 for Drupal 12.0.0.

Per #3406215: [policy] Default to requiring the latest stable PHP release available when a new major version reaches the first beta window, PHP 8.5.x will be the minimum required version for Drupal 12.

This will mean dropping testing on all PHP versions prior to PHP 8.5, so should not necessarily be a priority for early in the 12.x development cycle when we're still backporting most changes to 11.3/4.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3537713

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

quietone’s picture

Version: 11.2.x-dev » 11.x-dev
gábor hojtsy’s picture

Is PHP 8.5 the eventual minimum version of Drupal 12, or is this an interim step?

gábor hojtsy’s picture

Answering myself based on the rule linked, PHP 8.5.0 is at alpha now with a beta expected August 14, 2025 and stable somewhere in November 2025: https://www.php.net/supported-versions -- later PHP versions will not yet be stable when Drupal 12 reaches beta, so it will be PHP 8.5.x for sure for Drupal 12.

gábor hojtsy’s picture

Issue summary: View changes

Added the statement to the issue summary :)

cilefen’s picture

catch’s picture

Cross-referencing #3523596: [meta] PHP 8.5 support where PHP 8.5 support is being added.

catch’s picture

Status: Postponed » Active

mondrake made their first commit to this issue’s fork.

mondrake’s picture

Surely PHPStan will report new errors by raising the platform in composer.json. Let's find out for now.

voleger’s picture

Added child issue #3564075: Remove use of backtick operator in run-tests.sh for PHP 8.5
#3515347: Reduce run-tests.sh complexity in spawning subprocesses covers backtick deprecation message by removal of the related code block

voleger’s picture

liam morland made their first commit to this issue’s fork.

liam morland’s picture

Is there any chance that Drupal 12 will support being run on any versions of PHP older than PHP 8.5? The "PHP requirements" page does not currently document what versions are supported for Drupal 12.

longwave made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs work

I tried to remove the BC layer from mysql but PHPStan complains that these constants are all zero?

  Line   mysql/src/Driver/Database/mysql/Connection.php                      
 ------ -------------------------------------------------------------------- 
  125    Array has 3 duplicate keys with value 0                             
         (\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, \Pdo\Mysql::ATTR_FOUND_ROWS,  
         \Pdo\Mysql::ATTR_MULTI_STATEMENTS).                                 
         🪪  array.duplicateKey                                              

The stubs that ship with PhpStorm also show these constants as zero.

longwave’s picture

Status: Needs work » Needs review

Might have gone a bit far with removing PHP backward compatibility, we could split some of this out if we want to.

I also agree with @catch that we probably shouldn't commit this for a little while so we can be more confident about backports to 11.x.

longwave’s picture

Version: 11.x-dev » main
dcam’s picture

Status: Needs review » Needs work

The minimum version requirement is listed as PHP 8.3 twice in core/INSTALL.txt.

core/lib/Drupal/Core/Utility/PhpRequirements.php has the EOL date for PHP 8.3 in $phpEolDates.

And as I mentioned in #3567815: [D12][CI] Test on PHP 8.5 only there are three jobs for PHP 8.3 in .gitlab-ci.yml in the block that starts on line 407.

The current set of changes looks OK though. I double-checked all of the deletions and verified that the correct stuff got removed. The only remaining use of PHP_VERSION_ID is in TokenParser, which I assume we aren't editing because it's copied from Doctrine.

quietone’s picture

john franklin’s picture

Echoing @liam-morland's question above (emphasis mine):

Is there any chance that Drupal 12 will support being run on any versions of PHP older than PHP 8.5? The "PHP requirements" page does not currently document what versions are supported for Drupal 12.

Yes, the page has been updated to state 8.5 minimum for Drupal 12. The question is: Will PHP 8.4 be an option for Drupal 12?

The current Debian release (trixie) already supports 8.4, but PHP 8.5 isn't in the Debian repos, not even from Debian unstable (sid). Debian 14 (forky), the first release that could (and likely will) natively support PHP 8.5, is due out summer of 2027. PHP 8.4 will be supported until 2029.

While paths exist to install PHP 8.5 today (containers, third-party repos, build-from-source), I think the burden should be on Drupal to show why the absolute latest is necessary or why running on PHP n-1 is not possible.

Will PHP 8.4 remain an option for Drupal 12, and if not then what new feature of PHP 8.5 is critical for Drupal 12?

Moving this to the policy discussion in #3406215: [policy] Default to requiring the latest stable PHP release available when a new major version reaches the first beta window.

quietone’s picture

The changes for INSTALL.txt are in #3568123: Update INSTALL.txt for Drupal 12 and that is RTBC. These two should be committed at the same time.

longwave’s picture

Status: Needs work » Needs review

Addressed #21, and found another case in the package_manager tests that needs a small update. There are some other old BC layers lying around I think those should be handled elsewhere as they're not quite as straightforward, they aren't critical.

smustgrave’s picture

Question though. If this gets merged to main and those that are doing 11.x work won’t they have to now upgrade

catch’s picture

@smustgrave yes that's exactly the case. If you use ddev for core development it's pretty easy to update to 8.5 only in your core dev without worrying about any other environments though. Having said that I haven't actually done this yet on my own one.

For 11.x I think we delayed raising the actual version constraint until a bit later for this reason though, we could potentially do the same here (e.g. commit everything except for the minimum version change, then do that a bit closer to the time).

andypost’s picture

smustgrave’s picture

btw updating in ddev using just the config.yml gets 8.5.0RC3

godotislate’s picture

If you use ddev for core development it's pretty easy to update to 8.5 only in your core dev

Me, a month ago, thinking I was super smart, did this.
Me, last week, when doing a git bisect, had to revert and restart ddev.

(It was trivial but still super annoying.)

mondrake’s picture

mondrake’s picture

rebased and done #31

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new9.52 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nod_’s picture

Status: Needs work » Needs review
Issue tags: +no-needs-review-bot
dcam’s picture

My feedback was addressed. The additional changes to TemplateProjectTestBase make sense. I didn't know what was up with PHPStan, so I ran it locally and didn't have any errors. I think this is probably good to go. Don't forget the complimentary patch in #3568123: Update INSTALL.txt for Drupal 12.

dcam’s picture

Status: Needs review » Reviewed & tested by the community
godotislate’s picture

Don't think they're blockers, but had a couple questions about the Symfony polyfills for 8.4 and 8.5.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Yep let's skip installing those polyfills, good spot.

catch’s picture

With ddev installing an rc, I'm wondering if we should wait for a new ddev release here, apparently PHP 8.5 stable will be in v1.25.0 https://github.com/ddev/ddev/issues/8075

catch’s picture

Doesn't need to be done here necessarily, but we should be able to completely delete the classloader and related code added in #3502913: Add a fallback classloader that can handle missing traits for attribute discovery now. Was fixed in PHP 8.5 https://github.com/php/php-src/issues/17959

mondrake’s picture

Status: Needs work » Needs review

Done #37/38. #40 deserves an issue of its own IMO.

godotislate’s picture

Status: Needs review » Reviewed & tested by the community

#37/38 addressed, so lgtm.

mondrake’s picture

Rebased, PhpRequirements had conflicts.

smustgrave’s picture

Per #39 should this wait till ddev ships with a non RC version?

godotislate’s picture

Not necessary to wait, IMO. Per ddev maintainers on Slack:

You can add a custom .ddev/web-build/Dockerfile.update to a project:

RUN (apt-get update || true) && apt-get upgrade -y
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2b1cd68 and pushed to main. Thanks!

Yeah I don't think we need to wait. The ddev release will happen and there instructions to update are quite simple.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 2b1cd68a on main
    chore: #3537713 [12.x] Require PHP 8.5
    
    By: catch
    By: quietone
    By:...
larowlan’s picture

Opened #3570713: Bump PHPStan to 2.1.38 as I'm seeing an issue on HEAD when trying to commit another issue which might be related to the version bump

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

Wouldn't some coordination (or at least communication) between the DDEV team and Drupal core team be a great idea, to help streamline future dev-releases of Drupal, and their support in DDEV? Feel free to join the conversation in Add a project type for Drupal 12 #8055.