Problem/Motivation

Drupal 8.4.x is not compatible with PHP 7.2. In order to make Drupal 8 compatible with PHP7.2 we'd need to resolve #2923015: [PHP 7.2] Incompatible method declarations on 8.4.x but this is a breaking change.

Proposed resolution

Update core/composer.json to not allow install on PHP7.2

Remaining tasks

Given this is the first time we've done something like this I think we need release manager feedback.

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

The one downside of doing this is if someone is patching core to be compatible they'll have to have a patch to reverse this change too. The advantage of course is that someone doesn't waste time learning that 8.4.x is not PHP7.2 compatible.

alexpott’s picture

Hmm... this would only work for composer-only workflows where you try to get the entire drupal/core package. If you have the codebase already and just do a composer install it won't error. This is because of https://github.com/wikimedia/composer-merge-plugin/issues/96 - if you run composer update --lock it breaks as expected but it is unlikely people are doing that before running composer.install.

alexpott’s picture

Ah of course we need to update the lock file. Then it works... after doing this running composer install on PHP7.2 does:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php >=5.5.9 <7.2 but your PHP version (7.2.0) does not satisfy that requirement.

I'm still ambivalent about the patch... but at least it works. tbh honest if you look at a Drupal 8.4.x site on PHP 7.2 you can see it is pretty broken.

mondrake’s picture

Issue tags: +PHP 7.2
catch’s picture

I'm ambivalent as well. If PHP 7.2 had landed a week after 8.4.0 it'd be very annoying and we'd definitely want something like this. With 8.5.0-alpha1 out mid-January it's tempting to let it slide at this point.

alexpott’s picture

Yep it is tempting to leave this can of worms alone. Just tagging so all release managers can be aware.

pfrenssen’s picture

I think that the advantage of informing site maintainers about the incompatibility with PHP 7.2 far outweighs having another patch to apply for people that _do_ want to update to PHP 7.2. Depending on the technical skills of the people performing the updates it might not be obvious that PHP 7.2 is causing the fatal errors. At least with this patch they will get a clear message that indicates the source of the problem.

At least if they run the composer update on a machine that also uses PHP 7.2 :)

pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

Since this is tagged with release manager review I don't know if I'm allowed to RTBC this, but this looks ready to go to me.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

It is actually possible to do a clean install of standard with 8.4.x on PHP 7.2 if you have warnings disabled. The first hard break I encountered was on node/add/article - therefore, if we choose to do this, I think we need to add a system requirement too to prevent install and to put a big red error on admin/reports/status.

pfrenssen’s picture

Status: Needs work » Needs review
FileSize
2.64 KB
1.22 KB

Good point, added an error message during install and in the status report.

alexpott’s picture

+++ b/core/includes/bootstrap.inc
@@ -24,6 +24,11 @@
+/**
+ * Maximum supported version of PHP for Drupal 8.4.x and lower.
+ */
+const DRUPAL_MAXIMUM_PHP = '7.1.999';

Let's not introduce a constant otherwise we have to maintain it for all time. At the moment we do not know the maximum PHP for 8.5.x for example.

mondrake’s picture

OTH, having an upper limit for PHP would also have its benefits:

  • site builders/maintainers could be comfortable on installing Drupal without having to check in the issue queues whether the latest PHP version is supported
  • we could tollgate PHP versions supported rather than chasing PHP - see the recent PHP 7.2 example: if we had an upper limit of 7.1.999 for D8.4, that would have stayed and we would have moved the limit to 7.2.999 only for D8.5 after all the fixes to get it supported were in place. And so on.
alexpott’s picture

@mondrake to me all of this feels like a bad idea. If we do what you propose then even to make Drupal 8 work PHP 7.3 we have to patch it. Even PHPUnit with it's aggressive changing of support for PHP versions doesn't do this.

catch’s picture

Status: Needs review » Needs work

Agreed that we shouldn't introduce a constant for this.

xjm’s picture

8.4.4 was the last regular patch release of Drupal 8.4, so I'm not sure this issue is worth doing at this point. The February window is critical fixes only. I guess we could put this in there but people would only see it for a month until they could update to 8.5.0 anyway.

xjm’s picture

Status: Needs work » Closed (won't fix)
Issue tags: -Needs release manager review

@catch and I agreed to mark this wontfix for the above reason. Thanks everyone (and sorry for adding to the confusion by advertising our 7.2 support prematurely).