diff --git a/core/lib/Drupal/Component/Diff/DiffEngine.php b/core/lib/Drupal/Component/Diff/DiffEngine.php
index 2dd377f..83889d5 100644
--- a/core/lib/Drupal/Component/Diff/DiffEngine.php
+++ b/core/lib/Drupal/Component/Diff/DiffEngine.php
@@ -310,7 +310,7 @@ function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
         }
         $matches = $ymatches[$line];
         reset($matches);
-        while (list ($junk, $y) = each($matches)) {
+        foreach ($matches as $y) {
           if (empty($this->in_seq[$y])) {
             $k = $this->_lcs_pos($y);
             USE_ASSERTS && assert($k > 0);
@@ -318,7 +318,7 @@ function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
             break;
           }
         }
-        while (list ($junk, $y) = each($matches)) {
+        foreach ($matches as $y) {
           if ($y > $this->seq[$k-1]) {
             USE_ASSERTS && assert($y < $this->seq[$k]);
             // Optimization: this is a common case:
diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php
index 5088104..3136f2e 100644
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php
+++ b/core/lib/Drupal/Component/Gettext/PoHeader.php
@@ -228,7 +228,6 @@ function parsePluralForms($pluralforms) {
     // For data compression we store the last position the array value
     // changes and store it as default.
     $element_stack = $this->parseArithmetic($plural);
-    $default = 0;
     if ($element_stack !== FALSE) {
       for ($i = 0; $i <= 199; $i++) {
         $plurals[$i] = $this->evaluatePlural($element_stack, $i);
diff --git a/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php b/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php
index 88dd64c..0db05389 100644
--- a/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php
+++ b/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php
@@ -84,7 +84,6 @@ public function transliterate($string, $langcode = 'en', $unknown_character = '?
     // Split into Unicode characters and transliterate each one.
     foreach (preg_split('//u', $string, 0, PREG_SPLIT_NO_EMPTY) as $character) {
       $code = self::ordUTF8($character);
-      $to_add = '';
       if ($code == -1) {
         $to_add = $unknown_character;
       }
diff --git a/core/lib/Drupal/Component/Utility/Crypt.php b/core/lib/Drupal/Component/Utility/Crypt.php
index 535297d..ef5ebfe 100644
--- a/core/lib/Drupal/Component/Utility/Crypt.php
+++ b/core/lib/Drupal/Component/Utility/Crypt.php
@@ -30,7 +30,7 @@ class Crypt {
    */
   public static function randomBytes($count) {
     // $random_state does not use drupal_static as it stores random bytes.
-    static $random_state, $bytes, $has_openssl;
+    static $random_state, $bytes;
 
     $missing_bytes = $count - strlen($bytes);
 
diff --git a/core/lib/Drupal/Component/Utility/UserAgent.php b/core/lib/Drupal/Component/Utility/UserAgent.php
index 8b35c75..6a3b238 100644
--- a/core/lib/Drupal/Component/Utility/UserAgent.php
+++ b/core/lib/Drupal/Component/Utility/UserAgent.php
@@ -91,7 +91,6 @@ public static function getBestMatchingLangcode($http_accept_language, $langcodes
       // first occurrence of '-' otherwise we get a non-existing language zh.
       // All other languages use a langcode without a '-', so we can safely
       // split on the first occurrence of it.
-      $generic_tag = '';
       if (strlen($langcode) > 7 && (substr($langcode, 0, 7) == 'zh-hant' || substr($langcode, 0, 7) == 'zh-hans')) {
         $generic_tag = substr($langcode, 0, 7);
       }
