PackageTrack
Sign in Get early access

sebastian/diff

Diff implementation

9.0.0 975M downloads/mo #41 most downloaded on composer sebastianbergmann/diff

What this package is like to depend on

Last release 2 months ago

05 Jun 2026

Release timing varies

gaps range from 3 weeks to 12 months

Most releases are documented

notes for 25 of 39 stable releases

Nothing withdrawn

no release was ever pulled

13 years old

39 releases · first in 2013

6 releases in the last 12 months

see the full history below

Release timeline

39 releases · Jul 2013 to Jun 2026
2014 2016 2018 2020 2022 2024 2026
Release Pre-release

Releases

latest 39
  1. 9.0.0 05 Jun 2026
    Release notes

    Changed

    • #138: Use Eugene W. Myers' linear-space algorithm

    Removed

    • #157: The UnifiedDiffOutputBuilder and AbstractChunkOutputBuilder classes have been removed, use StrictUnifiedDiffOutputBuilder instead
    • The SebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() have been removed
    Open source →
    Release notes

    Changed

    • #138: Use Eugene W. Myers' linear-space algorithm

    Removed

    • #157: The UnifiedDiffOutputBuilder and AbstractChunkOutputBuilder classes have been removed, use StrictUnifiedDiffOutputBuilder instead
    • The SebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() have been removed
    Open source →
  2. 8.3.0 15 May 2026
    Release notes

    Added

    • #136: UnifiedDiffOutputBuilder now accepts a fourth $emitNoLineEndEofWarning constructor parameter (default true) to suppress the \ No newline at end of file marker for use cases such as PHPUnit comparison failures that are not related to files
    • #136: StrictUnifiedDiffOutputBuilder now accepts the options addLineNumbers, emitDiffLineEndWarning, emitNoLineEndEofWarning, and header

    Changed

    • #136: UnifiedDiffOutputBuilder now returns an empty string when no difference is detected (previously: returned the header)
    • #136: UnifiedDiffOutputBuilder::writeHunk() now writes the actual \ No newline at end of file marker text (previously: wrote only a line break) and silently skips diff entries with unknown types

    Deprecated

    • The SebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() are now deprecated; do not pass the $lcs parameter any more in preparation for the removal of these symbols and this parameter, respectively
    Open source →
    Release notes

    Added

    • #136: UnifiedDiffOutputBuilder now accepts a fourth $emitNoLineEndEofWarning constructor parameter (default true) to suppress the \ No newline at end of file marker for use cases such as PHPUnit comparison failures that are not related to files
    • #136: StrictUnifiedDiffOutputBuilder now accepts the options addLineNumbers, emitDiffLineEndWarning, emitNoLineEndEofWarning, and header

    Changed

    • #136: UnifiedDiffOutputBuilder now returns an empty string when no difference is detected (previously: returned the header)
    • #136: UnifiedDiffOutputBuilder::writeHunk() now writes the actual \ No newline at end of file marker text (previously: wrote only a line break) and silently skips diff entries with unknown types

    Deprecated

    • The SebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() are now deprecated; do not pass the $lcs parameter any more in preparation for the removal of these symbols and this parameter, respectively
    Open source →
  3. 8.2.1 14 May 2026
    Release notes

    Changed

    • #136: Reverted changes introduced in version 8.2.0
    Open source →
    Release notes

    Changed

    • #136: Reverted changes introduced in version 8.2.0
    Open source →
  4. 8.2.0 14 May 2026
    Release notes

    Changed

    • #136: Align UnifiedDiffOutputBuilder behavior with StrictUnifiedDiffOutputBuilder
    Open source →
    Release notes

    Changed

    • #136: Align UnifiedDiffOutputBuilder behavior with StrictUnifiedDiffOutputBuilder
    Open source →
  5. 8.1.0 05 Apr 2026
    Release notes

    Added

    • #135: Add $contextLines constructor parameter on UnifiedDiffOutputBuilder
    Open source →
    Release notes

    Added

    • #135: Add $contextLines constructor parameter on UnifiedDiffOutputBuilder
    Open source →
  6. 8.0.0 06 Feb 2026
    Release notes

    Removed

    • This component is no longer supported on PHP 8.3
    Open source →
    Release notes

    Removed

    • This component is no longer supported on PHP 8.3
    Open source →
  7. 7.0.0 07 Feb 2025
    Release notes

    Removed

    • This component is no longer supported on PHP 8.3
    Open source →
    Release notes

    Removed

    • This component is no longer supported on PHP 8.2
    Open source →
  8. 6.0.2 03 Jul 2024
    Release notes

    Changed

    • This project now uses PHPStan instead of Psalm for static analysis
    Open source →
    Release notes

    Changed

    • This project now uses PHPStan instead of Psalm for static analysis
    Open source →
  9. 6.0.1 02 Mar 2024
    Release notes

    Changed

    • Do not use implicitly nullable parameters
    Open source →
  10. 6.0.0 02 Feb 2024
    Release notes

    Removed

    • SebastianBergmann\Diff\Chunk::getStart(), SebastianBergmann\Diff\Chunk::getStartRange(), SebastianBergmann\Diff\Chunk::getEnd(), SebastianBergmann\Diff\Chunk::getEndRange(), and SebastianBergmann\Diff\Chunk::getLines()
    • SebastianBergmann\Diff\Diff::getFrom(), SebastianBergmann\Diff\Diff::getTo(), and SebastianBergmann\Diff\Diff::getChunks()
    • SebastianBergmann\Diff\Line::getContent() and SebastianBergmann\Diff\Diff::getType()
    • This component is no longer supported on PHP 8.1
    Open source →
  11. 5.1.1 02 Mar 2024
    Release notes

    Changed

    • Do not use implicitly nullable parameters
    Open source →
  12. 5.1.0 22 Dec 2023
    Release notes

    Added

    • SebastianBergmann\Diff\Chunk::start(), SebastianBergmann\Diff\Chunk::startRange(), SebastianBergmann\Diff\Chunk::end(), SebastianBergmann\Diff\Chunk::endRange(), and SebastianBergmann\Diff\Chunk::lines()
    • SebastianBergmann\Diff\Diff::from(), SebastianBergmann\Diff\Diff::to(), and SebastianBergmann\Diff\Diff::chunks()
    • SebastianBergmann\Diff\Line::content() and SebastianBergmann\Diff\Diff::type()
    • SebastianBergmann\Diff\Line::isAdded(),SebastianBergmann\Diff\Line::isRemoved(), and SebastianBergmann\Diff\Line::isUnchanged()

    Changed

    • SebastianBergmann\Diff\Diff now implements IteratorAggregate, iterating over it yields the aggregated SebastianBergmann\Diff\Chunk objects
    • SebastianBergmann\Diff\Chunk now implements IteratorAggregate, iterating over it yields the aggregated SebastianBergmann\Diff\Line objects

    Deprecated

    • SebastianBergmann\Diff\Chunk::getStart(), SebastianBergmann\Diff\Chunk::getStartRange(), SebastianBergmann\Diff\Chunk::getEnd(), SebastianBergmann\Diff\Chunk::getEndRange(), and SebastianBergmann\Diff\Chunk::getLines()
    • SebastianBergmann\Diff\Diff::getFrom(), SebastianBergmann\Diff\Diff::getTo(), and SebastianBergmann\Diff\Diff::getChunks()
    • SebastianBergmann\Diff\Line::getContent() and SebastianBergmann\Diff\Diff::getType()
    Open source →
  13. 5.0.3 01 May 2023
    Release notes

    Changed

    • #119: Improve performance of TimeEfficientLongestCommonSubsequenceCalculator
    Open source →
  14. 5.0.2 01 May 2023
    Release notes

    Changed

    • #118: Improve performance of MemoryEfficientLongestCommonSubsequenceCalculator
    Open source →
  15. 5.0.1 23 Mar 2023
    Release notes

    Fixed

    • #115: Parser::parseFileDiff() does not handle diffs correctly that only add lines or only remove lines
    Open source →
  16. 5.0.0 03 Feb 2023
    Release notes

    Changed

    • Passing a DiffOutputBuilderInterface instance to Differ::__construct() is no longer optional

    Removed

    • This component is no longer supported on PHP 7.3, PHP 7.4, and PHP 8.0
    Open source →
  17. 4.0.6 02 Mar 2024

    Nothing published for this version

  18. 4.0.5 07 May 2023

    Nothing published for this version

  19. 4.0.4 26 Oct 2020
    Release notes

    Fixed

    • SebastianBergmann\Diff\Exception now correctly extends \Throwable
    Open source →
  20. 4.0.3 28 Sep 2020
    Release notes

    Changed

    • Changed PHP version constraint in composer.json from ^7.3 || ^8.0 to >=7.3
    Open source →
  21. 4.0.2 30 Jun 2020
    Release notes

    Added

    • This component is now supported on PHP 8
    Open source →
  22. 4.0.1 08 May 2020
    Release notes

    Fixed

    • #99: Regression in unified diff output of identical strings
    Open source →
  23. 4.0.0 07 Feb 2020
    Release notes

    Removed

    • This component is no longer supported on PHP 7.1 and PHP 7.2
    Open source →
  24. 3.0.6 02 Mar 2024

    Nothing published for this version

  25. 3.0.5 01 Mar 2024

    Nothing published for this version

  26. 3.0.4 07 May 2023

    Nothing published for this version

  27. 3.0.3 30 Nov 2020

    Nothing published for this version

  28. 3.0.2 04 Feb 2019
    Release notes

    Changed

    • Chunk::setLines() now ensures that the $lines array only contains Line objects
    Open source →
  29. 3.0.1 10 Jun 2018
    Release notes

    Fixed

    • Removed "minimum-stability": "dev", from composer.json
    Open source →
  30. 3.0.0 01 Feb 2018
    Release notes
    • The StrictUnifiedDiffOutputBuilder implementation of the DiffOutputBuilderInterface was added

    Changed

    • The default DiffOutputBuilderInterface implementation now generates context lines (unchanged lines)

    Removed

    • This component is no longer supported on PHP 7.0

    Fixed

    • #70: Diffing of arrays no longer works
    Open source →
  31. 2.0.1 03 Aug 2017
    Release notes

    Fixed

    • #66: Restored backwards compatibility for PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3
    Open source →
  32. 1.4.3 22 May 2017

    Nothing published for this version

  33. 1.4.2 18 May 2017

    Nothing published for this version

  34. 1.4.1 08 Dec 2015

    Nothing published for this version

  35. 1.4.0 06 Dec 2015

    Nothing published for this version

  36. 1.3.0 22 Feb 2015

    Nothing published for this version

  37. 1.2.0 15 Aug 2014

    Nothing published for this version

  38. 1.1.0 03 Aug 2013

    Nothing published for this version

  39. 1.0.0 09 Jul 2013

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive