NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1318 most downloaded on Packagist
A comprehensive library for generating differences between two strings in multiple formats (unified, side by side HTML etc).
Latest stable
7.0.1
Last release 5 months ago
22 Jun 2026
Ships unpredictably
gaps range from 1 weeks to 2.1 years
Most releases are documented
notes for 53 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
151 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Fix comparing numeric strings (e.g. '0' vs '00000') producing an empty diff (#94).
'0' vs '00000') producing an empty diff (#94).There is no new feature in this major release. The main focus is to modernize the codebase and improve type safety.
There is no new feature in this major release. The main focus is to modernize the codebase and improve type safety.
DifferOptions value object.RendererOptions value object.For migration guide, see https://github.com/jfcherng/php-diff/blob/v7/UPGRADING/UPGRADING_v7.md
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Fix comparing numeric strings (e.g. '0' vs '00000') producing an empty diff (#94).
'0' vs '00000') producing an empty diff (#94).fix: remove debug print
fix: Differ::getStatistics() not working when no difference
Differ::getStatistics() not working when no differencechore: fix deprecated php-cs-fixer options
fullContextIfIdentical (#79)chore: add cze (Czech) translation
cze (Czech) translation (#74)chore: add nob (Norwegian) translation
nob (Norwegian) translation (#73)Nothing published for this version
feat: add new differOption: lengthLimit
feat: add new differOption: lengthLimit
Previously this is hard-coded as 1000 in https://github.com/jfcherng/php-sequence-matcher/blob/3.2.9/src/SequenceMatcher.php#LL683C28-L683C32
Fixes https://github.com/jfcherng/php-diff/issues/71
fix: (Combined) unmerge-able block shouldn't be repeated
Nothing published for this version
feat: add differ option: ignoreLineEnding
ignoreLineEndingfix: another way to fix \r shouldn't be visualized like a newline in Combined renderer
feat: provide a way to override an existing language
feat: provide a way to override an existing language
Check https://github.com/jfcherng/php-diff/blob/6.13.0/README.md#override-an-existing-language
fix: side-by-side column too narrow
feat: new rendererOption: spaceToHtmlTag
spaceToHtmlTag (#60)tabSize on browserfix: Combined::renderArray isn't working properly
Combined::renderArray isn't working properly- chore: update deps (upstream)
chore: add ita (Italian) translation
ita (Italian) translationrefactor: utilize PHP 7.4 typed properties (only for final classes since it's a BC breaking change)
final classes since it's a BC breaking change)fix: wrong execution result under php alpine image
chore: add ukr (Ukraine) translation
ukr (Ukraine) translationchore: bump min PHP requirement to 7.4
chore: bump min PHP requirement to 7.4
6.10 and before requires PHP >= 7.1refactor: use PHP new features
Ported changes from 6.16.x: - fix: remove debug print
Ported changes from 6.16.x:
fix: Differ::getStatistics() not working when no difference
Ported changes from 6.16.x:
Differ::getStatistics() not working when no differencechore: fix deprecated php-cs-fixer options
Ported changes from 6.16.x:
fullContextIfIdentical (https://github.com/jfcherng/php-diff/pull/79)chore: add cze (Czech) translation
Ported changes from 6.15.x:
cze (Czech) translation (#74)chore: add nob (Norwegian) translation
Ported changes from 6.15.x:
nob (Norwegian) translation (#73)feat: add new differOption: lengthLimit
Ported changes from 6.15.x:
feat: add new differOption: lengthLimit
Previously this is hard-coded as 1000 in https://github.com/jfcherng/php-sequence-matcher/blob/3.2.9/src/SequenceMatcher.php#LL683C28-L683C32
Fixes https://github.com/jfcherng/php-diff/issues/71
fix: (Combined) unmerge-able block shouldn't be repeated
Ported changes from 6.14.x:
Nothing published for this version
feat: add differ option: ignoreLineEnding
Ported changes from 6.14.x:
ignoreLineEndingfeat: provide a way to override an existing language
Ported changes from 6.13.x:
feat: provide a way to override an existing language
Check https://github.com/jfcherng/php-diff/blob/6.10.8/README.md#override-an-existing-language
fix: side-by-side column too narrow
feat: new rendererOption: spaceToHtmlTag
Ported changes from 6.12.x:
spaceToHtmlTag (#60)tabSize on browserfix: Combined::renderArray isn't working properly
Ported changes from 6.11.x:
Combined::renderArray isn't working properly- chore: update deps (upstream)
chore: add ita (Italian) translation
Ported changes from 6.11.x:
ita (Italian) translationukr (Ukraine) translationNothing published for this version
Nothing published for this version
fix: deprecated method in .php_cs
chore: add liip/rmt as a dev dependency
chore: allow phan/phan ^4
feat: add methods to get diff statistics
$differ->getStatistics();
DiffHelper::getStatistics();
both return something like
[
'inserted' => 0,
'deleted' => 0,
'unmodified' => 0,
'changedRatio' => 0.0,
]
fix: deprecated method in .php_cs
- feat: add option: showHeader
showHeader (https://github.com/jfcherng/php-diff/issues/42)The previous Json renderer has been deprecated. You may use JsonHtml instead, for a more explicit name with a comparison to JsonText.
feat: add renderer: JsonText (https://github.com/jfcherng/php-diff/issues/40)
The previous Json renderer has been deprecated. You may use JsonHtml instead, for a more explicit name with a comparison to JsonText.
fix: a regression about the last diff block
fix: ignoreWhitespaces doesn't produce the same result with GNU diff's
ignoreWhitespaces doesn't produce the same result with GNU diff's (#35)fix: \r shouldn't be visualized like a newline in Combined renderer
\r shouldn't be visualized like a newline in Combined renderer (#34)fix: OP_EQ lines are not escaped in Combined renderer
OP_EQ lines are not escaped in Combined rendererNothing published for this version
fix: unexpected Combined output due to HTML formatting
refactor: colorization with jfcherng/php-color-output
feat: support colorized CLI output for text renderers (https://github.com/jfcherng/php-diff/pull/29) !2020-04-06_21-02-17
- feat: add Spanish translation
Nothing published for this version
fix: wordGlues works wrongly under some circumstances
wordGlues works wrongly under some circumstances (#25)- Add German (deu) translation.
German (deu) translation.Add new renderer option: wordGlues.
Add new renderer option: wordGlues.
This option is introduced to improve the readability for word-level diff. By default, - and are treated as "glues" to merge consecutive diffs into a whole.
Add Json renderer option: jsonEncodeFlags.
Json renderer option: jsonEncodeFlags.One column per quarter.