sebastianbergmann/diff

Values should be compared strictly when computing LCS.

jesseschalken opened this issue · 0 comments

$d = new \SebastianBergmann\Diff\LCS\MemoryEfficientImplementation;

var_dump( $d->calculate( array( '5' ), array( '05' ) ) );

results in:

array(1) {
  [0] =>
  string(1) "5"
}

but it should result in:

array(0) {
}

because '5' and '05' are not the same.

The practical result is that I had a file for which a line containing a single number had zeros added to the start, but the differ reported that there was no difference.

It seems this is just a matter of changing the == that is used when comparing input values to ===.