function Differ::diff
Same name in this branch
- 11.1.x vendor/phpstan/phpdoc-parser/src/Printer/Differ.php \PHPStan\PhpDocParser\Printer\Differ::diff()
- 11.1.x vendor/sebastian/diff/src/Differ.php \SebastianBergmann\Diff\Differ::diff()
Calculate diff (edit script) from $old to $new.
Parameters
T[] $old Original array:
T[] $new New array:
Return value
DiffElem[] Diff (edit script)
1 call to Differ::diff()
- Differ::diffWithReplacements in vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ Differ.php - Calculate diff, including "replace" operations.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ Differ.php, line 35
Class
- Differ
- Implements the Myers diff algorithm.
Namespace
PhpParser\InternalCode
public function diff(array $old, array $new) : array {
$old = \array_values($old);
$new = \array_values($new);
list($trace, $x, $y) = $this->calculateTrace($old, $new);
return $this->extractDiff($trace, $x, $y, $old, $new);
}