Problem/Motivation

Drupal 8 supports older versions of PHP 7, primarily because some distributions (e.g., Ubuntu) provide LTS security coverage for PHP longer than the core PHP maintainers. Currently, the minimum version supported is 7.0.8, and Commerce de facto inherits that constraint.

Because of core's broader span of supported PHP versions, we are effectively unable to adopt certain new language constructs and features. E.g., this CI job failed because nullable parameters were only introduced in PHP 7.1.

Drupal Commerce is one of the most progressive contrib ecosystems in terms of code style, however core's limitations effectively pin us at 7.0. This is in addition to being end of life.

While this would be a disruptive change for some, running a supported PHP version is much less difficult than it used to be; most all commodity hosting platforms used the EOL of PHP 5 to get on a more aggressive upgrade schedule. Acquia, for instance, automatically upgrades customer instances.

Furthermore, the majority of sites with Drupal Commerce 2.x have some type of PCI compliance burden, even if it is simply A/A-EP. This standard still requires security patches be applied as available (section 6.2(a)).

Proposed resolution

Add a version constraint in Commerce's composer.json to match the minimum supported minor version of PHP (currently ^7.2).

This would effectively require other installed contrib modules to be compatible, however there are no breaking changes between minor versions of PHP 7, so this is a minor concern. Basically, we lose nothing by raising the bar but miss out on higher-quality, safer and more resilient code constructs by waiting for core.

Remaining tasks

Change record.

CommentFileSizeAuthor
#7 4.diff449 bytesbradjones1
#6 4.diff451 bytesbradjones1

Issue fork commerce-3165544

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

bradjones1 created an issue. See original summary.

olafkarsten’s picture

very short: +1

short: I like that proposal. As a module maintainer I don't see any significant problems with it. I guess communication is the real challenge with this sort of issues.

andrewbelcher’s picture

I am very pro using a more recent version of PHP and the language features it provides!

My take would be rather than arbitrarily use the current minimum supported minor and update with every release would be to up it when we have language features we want to make use of.

I'd also be wary of immediately dropping support for the most recent EOL version, I expect there will be a hosts who use EOL as their prompt to update, rather than a new release. If they are reactive, rather than proactive, that could result in a transition period that could be awkward for site maintainers.

bradjones1’s picture

Status: Active » Needs review

Issue fork created. Let's see if this prompts a CI build...I don't think they have manual actions yet.

bradjones1’s picture

StatusFileSize
new451 bytes

Let's see if I can choose test options with a patch file.

bradjones1’s picture

StatusFileSize
new449 bytes
bradjones1’s picture

Ah well pleasant surprise, 9.0 requires >=7.3. Seems we can follow that, saving some bikeshedding here.

bradjones1’s picture