diff --git a/DiffEngine.php b/DiffEngine.php
index 1674882..16b65d1 100644
--- a/DiffEngine.php
+++ b/DiffEngine.php
@@ -312,7 +312,8 @@ class _DiffEngine {
         }
         $matches = $ymatches[$line];
         reset($matches);
-        while (list ($junk, $y) = each($matches)) {
+        while ($y = current($matches)) {
+          next($matches);
           if (empty($this->in_seq[$y])) {
             $k = $this->_lcs_pos($y);
             USE_ASSERTS && assert($k > 0);
@@ -320,7 +321,8 @@ class _DiffEngine {
             break;
           }
         }
-        while (list ($junk, $y) = each($matches)) {
+        while ($y = current($matches)) {
+          next($matches);
           if ($y > $this->seq[$k-1]) {
             USE_ASSERTS && assert($y < $this->seq[$k]);
             // Optimization: this is a common case:
