diff --git a/composer.lock b/composer.lock
index 21fb0fdca2..702385e499 100644
--- a/composer.lock
+++ b/composer.lock
@@ -2798,15 +2798,9 @@
             "version": "8.2.12",
             "source": {
                 "type": "git",
-                "url": "https://github.com/klausi/coder.git",
+                "url": "https://git.drupal.org/project/coder.git",
                 "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f"
             },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/klausi/coder/zipball/984c54a7b1e8f27ff1c32348df69712afd86b17f",
-                "reference": "984c54a7b1e8f27ff1c32348df69712afd86b17f",
-                "shasum": ""
-            },
             "require": {
                 "ext-mbstring": "*",
                 "php": ">=5.4.0",
@@ -4260,7 +4254,7 @@
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=5.5.9"
+        "php": ">=5.5.9 <7.2"
     },
     "platform-dev": []
 }
diff --git a/core/composer.json b/core/composer.json
index fe99c280b1..6df2b1dee3 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -4,7 +4,7 @@
     "type": "drupal-core",
     "license": "GPL-2.0+",
     "require": {
-        "php": ">=5.5.9",
+        "php": ">=5.5.9 <7.2",
         "symfony/class-loader": "~3.2.8",
         "symfony/console": "~3.2.8",
         "symfony/dependency-injection": "~3.2.8",
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 52f574212a..20cd768108 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -24,6 +24,11 @@
  */
 const DRUPAL_MINIMUM_PHP = '5.5.9';
 
+/**
+ * Maximum supported version of PHP for Drupal 8.4.x and lower.
+ */
+const DRUPAL_MAXIMUM_PHP = '7.1.999';
+
 /**
  * Minimum recommended value of PHP memory_limit.
  *
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index bb69bd33f5..f8d1b0deef 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -184,6 +184,12 @@ function system_requirements($phase) {
     return $requirements;
   }
 
+  if (version_compare($phpversion, DRUPAL_MAXIMUM_PHP) > 0) {
+    $requirements['php']['description'] = t('Drupal 8.4.x is not compatible with PHP 7.2 and higher. Please use PHP 7.1.x.');
+    $requirements['php']['severity'] = REQUIREMENT_ERROR;
+    return $requirements;
+  }
+
   // Suggest to update to at least 5.5.21 or 5.6.5 for disabling multiple
   // statements.
   if (($phase === 'install' || \Drupal::database()->driver() === 'mysql') && !SystemRequirements::phpVersionWithPdoDisallowMultipleStatements($phpversion)) {
