diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 674276c..02c97f5 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -871,11 +871,11 @@ protected function initializeContainer() { // one from scratch. if (!isset($container) && !isset($container_definition)) { // Building the container creates 1000s of objects. Garbage collection of - // these objects is expensive. Additionally, it appears to be causing - // random segmentation faults in PHP 5.6 due to + // these objects is expensive. This appears to be causing random + // segmentation faults in PHP 5.6 due to // https://bugs.php.net/bug.php?id=72286. Once the container is rebuilt, // garbage collection is re-enabled. - $disable_gc = gc_enabled(); + $disable_gc = version_compare(PHP_VERSION, '7', '<') && gc_enabled(); if ($disable_gc) { gc_collect_cycles(); gc_disable();