diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 7aa8ee7..2639850 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -392,7 +392,7 @@ function _batch_next_set() {
       // We use our stored copies of $form and $form_state to account for
       // possible alterations by previous form submit handlers.
       $complete_form = &$batch['form_state']->getCompleteForm();
-      call_user_func_array($callback, array(&$complete_form, &$batch['form_state']));
+      $callback($complete_form, $batch['form_state']);
     }
     return TRUE;
   }
@@ -417,7 +417,7 @@ function _batch_finished() {
       if (is_callable($batch_set['finished'])) {
         $queue = _batch_queue($batch_set);
         $operations = $queue->getAllItems();
-        call_user_func_array($batch_set['finished'], array($batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval($batch_set['elapsed'] / 1000)));
+        $batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval($batch_set['elapsed'] / 1000));
       }
     }
   }
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 1c88201..8d07920 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -475,7 +475,12 @@ function template_preprocess_form_element(&$variables) {
   // Add label_display and label variables to template.
   $variables['label_display'] = $element['#title_display'];
   $variables['label'] = array('#theme' => 'form_element_label');
-  $variables['label'] += array_intersect_key($element, array_flip(array('#id', '#required', '#title', '#title_display')));
+  $variables['label'] += array_intersect_key($element, array(
+    '#id' => 1,
+    '#required' => 1,
+    '#title' => 1,
+    '#title_display' => 1,
+  ));
 
   $variables['children'] = $element['#children'];
 }
diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php
index e0d4e0d..60a5094 100644
--- a/core/lib/Drupal/Core/Config/ConfigImporter.php
+++ b/core/lib/Drupal/Core/Config/ConfigImporter.php
@@ -492,7 +492,7 @@ public function doSyncStep($sync_step, &$context) {
       $this->$sync_step($context);
     }
     elseif (is_callable($sync_step)) {
-      call_user_func_array($sync_step, array(&$context, $this));
+      $sync_step($context, $this);
     }
     else {
       throw new \InvalidArgumentException('Invalid configuration synchronization step');
diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index 5450e25..d12c7d6 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -290,7 +290,7 @@ public function buildEntity(array $form, FormStateInterface $form_state) {
     // properties.
     if (isset($form['#entity_builders'])) {
       foreach ($form['#entity_builders'] as $function) {
-        call_user_func_array($function, array($entity->getEntityTypeId(), $entity, &$form, &$form_state));
+        $function($entity->getEntityTypeId(), $entity, $form, $form_state);
       }
     }
 
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index fe6d104..3153786 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -851,9 +851,10 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
     // Allow for elements to expand to multiple elements, e.g., radios,
     // checkboxes and files.
     if (isset($element['#process']) && !$element['#processed']) {
-      foreach ($element['#process'] as $callback) {
+      foreach ($element['#process'] as $process) {
         $complete_form = &$form_state->getCompleteForm();
-        $element = call_user_func_array($form_state->prepareCallback($callback), array(&$element, &$form_state, &$complete_form));
+        $callback = $form_state->prepareCallback($process);
+        $element = $callback($element, $form_state, $complete_form);
       }
       $element['#processed'] = TRUE;
     }
@@ -923,8 +924,9 @@ public function doBuildForm($form_id, &$element, FormStateInterface &$form_state
     // The #after_build flag allows any piece of a form to be altered
     // after normal input parsing has been completed.
     if (isset($element['#after_build']) && !isset($element['#after_build_done'])) {
-      foreach ($element['#after_build'] as $callback) {
-        $element = call_user_func_array($form_state->prepareCallback($callback), array($element, &$form_state));
+      foreach ($element['#after_build'] as $after_build) {
+        $callback = $form_state->prepareCallback($after_build);
+        $element = callback($element, $form_state);
       }
       $element['#after_build_done'] = TRUE;
     }
@@ -1077,7 +1079,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
         // If we have input for the current element, assign it to the #value
         // property, optionally filtered through $value_callback.
         if ($input_exists) {
-          $element['#value'] = call_user_func_array($value_callable, array(&$element, $input, &$form_state));
+          $element['#value'] = $value_callable($element, $input, $form_state);
 
           if (!isset($element['#value']) && isset($input)) {
             $element['#value'] = $input;
@@ -1092,7 +1094,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$
       if (!isset($element['#value'])) {
         // Call #type_value without a second argument to request default_value
         // handling.
-        $element['#value'] = call_user_func_array($value_callable, array(&$element, FALSE, &$form_state));
+        $element['#value'] = $value_callable($element, FALSE, $form_state);
 
         // Final catch. If we haven't set a value yet, use the explicit default
         // value. Avoid image buttons (which come with garbage value), so we
diff --git a/core/lib/Drupal/Core/Form/FormSubmitter.php b/core/lib/Drupal/Core/Form/FormSubmitter.php
index a9bd0ac..f135ee5 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitter.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitter.php
@@ -113,7 +113,8 @@ public function executeSubmitHandlers(&$form, FormStateInterface &$form_state) {
         $batch['has_form_submits'] = TRUE;
       }
       else {
-        call_user_func_array($form_state->prepareCallback($callback), array(&$form, &$form_state));
+        $callback = $form_state->prepareCallback($callback);
+        $callback($form, $form_state);
       }
     }
   }
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index 96f2320..3e49b0a 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -84,8 +84,9 @@ public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
       $handlers = $form['#validate'];
     }
 
-    foreach ($handlers as $callback) {
-      call_user_func_array($form_state->prepareCallback($callback), array(&$form, &$form_state));
+    foreach ($handlers as $handler) {
+      $callback = $form_state->prepareCallback($handler);
+      $callback($form, $form_state);
     }
   }
 
@@ -270,7 +271,8 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $
       elseif (isset($elements['#element_validate'])) {
         foreach ($elements['#element_validate'] as $callback) {
           $complete_form = &$form_state->getCompleteForm();
-          call_user_func_array($form_state->prepareCallback($callback), array(&$elements, &$form_state, &$complete_form));
+          $callback = $form_state->prepareCallback($callback);
+          $callback($elements, $form_state, $complete_form);
         }
       }
 
diff --git a/core/lib/Drupal/Core/Utility/ThemeRegistry.php b/core/lib/Drupal/Core/Utility/ThemeRegistry.php
index c5e6055..a93b930 100644
--- a/core/lib/Drupal/Core/Utility/ThemeRegistry.php
+++ b/core/lib/Drupal/Core/Utility/ThemeRegistry.php
@@ -101,7 +101,7 @@ public function has($key) {
     // are not registered, just check the existence of the key in the registry.
     // Use array_key_exists() here since a NULL value indicates that the theme
     // hook exists but has not yet been requested.
-    return array_key_exists($key, $this->storage);
+    return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
   }
 
   /**
