PHPackages                             ezsystems/diff - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ezsystems/diff

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ezsystems/diff
==============

Diff implementation

4.0.0(6y ago)6673.2k↓14.9%BSD-3-ClausePHPPHP ^7.3

Since Jul 9Pushed 4y agoCompare

[ Source](https://github.com/ezsystems/diff)[ Packagist](https://packagist.org/packages/ezsystems/diff)[ Docs](https://github.com/sebastianbergmann/diff)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ RSS](/packages/ezsystems-diff/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (0)

sebastian/diff
==============

[](#sebastiandiff)

[![CI Status](https://github.com/sebastianbergmann/diff/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/diff/actions)[![Type Coverage](https://camo.githubusercontent.com/10d174d83b6f822a8ff32b1d01adc0b15a00e8dd4a8a95885ee79da78813556e/68747470733a2f2f73686570686572642e6465762f6769746875622f73656261737469616e626572676d616e6e2f646966662f636f7665726167652e737667)](https://shepherd.dev/github/sebastianbergmann/diff)

Diff implementation for PHP, factored out of PHPUnit into a stand-alone component.

Installation
------------

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require sebastian/diff

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev sebastian/diff

```

### Usage

[](#usage)

#### Generating diff

[](#generating-diff)

The `Differ` class can be used to generate a textual representation of the difference between two strings:

```
