Skip to content
Permalink
Browse files

Replace deprecated each() with foreach()

each() is deprecated in PHP 7.2
  • Loading branch information...
Jonathan Hammer
Jonathan Hammer committed Nov 16, 2018
1 parent bf5bf15 commit b96de19b3a3bf284855b8d38a5c75195e8892f90
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/wp/Text/Diff/Engine/native.php
@@ -190,15 +190,15 @@ function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
}
$matches = $ymatches[$line];
reset($matches);
while (list(, $y) = each($matches)) {
foreach ($matches as $ignore => $y) {
if (empty($this->in_seq[$y])) {
$k = $this->_lcsPos($y);
assert($k > 0);
$ymids[$k] = $ymids[$k - 1];
break;
}
}
while (list(, $y) = each($matches)) {
foreach ($matches as $ignore => $y) {
if ($y > $this->seq[$k - 1]) {
assert($y <= $this->seq[$k]);
/* Optimization: this is a common case: next match is

0 comments on commit b96de19

Please sign in to comment.
You can’t perform that action at this time.