diff --git a/run-tests.php b/run-tests.php index 57486b1d073..0b7d88877db 100755 --- a/run-tests.php +++ b/run-tests.php @@ -3982,11 +3982,11 @@ final class Differ reset($to); foreach ($common as $token) { - while (!($this->isEqual)(reset($from), $token)) { + while (!empty($from) && !($this->isEqual)(reset($from), $token)) { $diff[] = [array_shift($from), self::REMOVED, $fromLine++]; } - while (!($this->isEqual)($token, reset($to))) { + while (!empty($to) && !($this->isEqual)($token, reset($to))) { $diff[] = [array_shift($to), self::ADDED, $toLine++]; }