diff --git a/core/core.api.php b/core/core.api.php
index baba9a2..e59bd2c 100644
--- a/core/core.api.php
+++ b/core/core.api.php
@@ -1004,7 +1004,7 @@
  * verified with standard control structures at all times, not just checked in
  * development environments with assert() statements on.
  *
- * When runtime assertions fail in PHP 7 an \AssertionException is thrown.
+ * When runtime assertions fail in PHP 7 an \AssertionError is thrown.
  * Drupal uses an assertion callback to do the same in PHP 5.x so that unit
  * tests involving runtime assertions will work uniformly across both versions.
  *
diff --git a/core/lib/Drupal/Component/Assertion/Handle.php b/core/lib/Drupal/Component/Assertion/Handle.php
new file mode 100644
index 0000000..08131e6
--- /dev/null
+++ b/core/lib/Drupal/Component/Assertion/Handle.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\Component\Assertion\Handle.
+ */
+
+// Force the AssertionError class to exist at the root namespace for PHP 5.
+// This class exists natively in PHP 7. Note that in PHP 7 it extends from
+// Error, not Exception, but that isn't possible for PHP 5 - all exceptions
+// must extend from exception.
+namespace {
+  if(!class_exists('AssertionError', FALSE)) {
+    class AssertionError extends Exception {}
+  }
+}
+
+namespace Drupal\Component\Assertion {
+  /**
+   * Handler for runtime assertion failures.
+   *
+   * This class allows PHP 5.x to throw exceptions on runtime assertion fails
+   * in the same manner as PHP 7, and sets the ASSERT_EXCEPTION flag to TRUE
+   * for the PHP 7 runtime.
+   *
+   * @ingroup php_assert
+   */
+  class Handle {
+    /**
+     * Registers an assertion handler in PHP 5, sets exception throwing in PHP 7.
+     */
+    public static function register() {
+      if (version_compare(PHP_VERSION, '7.0.0-dev') < 0) {
+        assert_options(ASSERT_CALLBACK, function($file, $line, $code, $message) {
+          if (empty($message)) {
+            $message = $code;
+          }
+          throw new \AssertionError($message);
+        });
+      }
+      else {
+        assert_options(ASSERT_EXCEPTION, TRUE);
+      }
+    }
+
+  }
+
+}
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 4747440..89c299b 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -848,6 +848,11 @@ public static function bootEnvironment() {
         // Simpletest's internal browser.
         define('DRUPAL_TEST_IN_CHILD_SITE', TRUE);
 
+        // Turn assertions on, sync PHP 5 & 7's handling of them.
+        assert_options(ASSERT_ACTIVE, TRUE);
+        // No use statement for this, we don't use this class outside testing.
+        \Drupal\Component\Assertion\Handle::register();
+
         // Log fatal errors to the test site directory.
         ini_set('log_errors', 1);
         ini_set('error_log', DRUPAL_ROOT . '/sites/simpletest/' . substr($test_prefix, 10) . '/error.log');
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index 1f97845..d33907c 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -164,7 +164,15 @@ function stubTest() {
     $site_path = $this->container->get('site.path');
     file_put_contents($key_file, $private_key);
 
-    // This causes the first of the fifteen passes asserted in
+    // Check to see if runtime assertions are indeed on, if successful this
+    // will be the first of sixteen passes asserted in confirmStubResults()
+    try {
+      assert(FALSE, 'Lorem Ipsum');
+      $this->fail('Runtime assertions are not working.');
+    } catch (\AssertionError $e) {
+      $this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.');
+    }
+    // This causes the second of the sixteen passes asserted in
     // confirmStubResults().
     $this->pass($this->passMessage);
 
@@ -175,7 +183,7 @@ function stubTest() {
     // confirmStubResults().
     $this->fail($this->failMessage);
 
-    // This causes the second to fourth of the fifteen passes asserted in
+    // This causes the third to fifth of the sixteen passes asserted in
     // confirmStubResults().
     $user = $this->drupalCreateUser(array($this->validPermission), 'SimpleTestTest');
 
@@ -183,15 +191,15 @@ function stubTest() {
     $this->drupalCreateUser(array($this->invalidPermission));
 
     // Test logging in as a user.
-    // This causes the fifth to ninth of the fifteen passes asserted in
+    // This causes the sixth to tenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->drupalLogin($user);
 
-    // This causes the tenth of the fifteen passes asserted in
+    // This causes the eleventh of the sixteen passes asserted in
     // confirmStubResults().
     $this->pass(t('Test ID is @id.', array('@id' => $this->testId)));
 
-    // These cause the eleventh to fourteenth of the fifteen passes asserted in
+    // These cause the twelfth to fifteenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->assertTrue(file_exists($site_path . '/settings.testing.php'));
     // Check the settings.testing.php file got included.
@@ -206,7 +214,7 @@ function stubTest() {
     // Generates a warning inside a PHP function.
     array_key_exists(NULL, NULL);
 
-    // This causes the fifteenth of the fifteen passes asserted in
+    // This causes the sixteenth of the sixteen passes asserted in
     // confirmStubResults().
     $this->assertNothing();
 
@@ -250,7 +258,7 @@ function confirmStubTestResults() {
 
     $this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
 
-    $this->assertEqual('15 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
+    $this->assertEqual('16 passes, 3 fails, 2 exceptions, 3 debug messages', $this->childTestResults['summary']);
 
     $this->testIds[] = $test_id = $this->getTestIdFromResults();
     $this->assertTrue($test_id, 'Found test ID in results.');
diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php
index ac8afbd..9fc2b11 100644
--- a/core/tests/bootstrap.php
+++ b/core/tests/bootstrap.php
@@ -92,3 +92,6 @@ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $l
 // and DST). This choice is made to prevent timezone related regressions and
 // reduce the fragility of the testing system in general.
 date_default_timezone_set('Australia/Sydney');
+
+// Register the default assertion handler.
+\Drupal\Component\Assertion\Handle::register();
diff --git a/sites/example.settings.local.php b/sites/example.settings.local.php
index 34b4e19..23090a4 100644
--- a/sites/example.settings.local.php
+++ b/sites/example.settings.local.php
@@ -27,7 +27,8 @@
  *
  * @see https://wiki.php.net/rfc/expectations
  */
-assert_options(ASSERT_ACTIVE, 1);
+assert_options(ASSERT_ACTIVE, TRUE);
+\Drupal\Component\Assertion\Handle::register();
 
 /**
  * Enable local development services.
