PHPackages                             martynbiz/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. martynbiz/diff

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

martynbiz/diff
==============

Diff helps you generating difference views between two or three text files.

4131PHP

Since Jul 6Pushed 11y ago2 watchersCompare

[ Source](https://github.com/martynbiz/diff)[ Packagist](https://packagist.org/packages/martynbiz/diff)[ RSS](/packages/martynbiz-diff/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

\#Diff#

\##Introduction##

Engine for performing and rendering text diffs. Basically the old PEAR library but I added 5.3+ namespacing and intend to include a patch method.

\##Installation##

```
composer require martynbiz/diff

```

\##Usage##

```
// code to highlight the difference between strings
$a_lines = explode("\n", $a);
$b_lines = explode("\n", $b);

$check_diff = new \MartynBiz\Diff\Diff( 'auto', array($a_lines, $b_lines) );

// set which render to use
// $renderer = new \MartynBiz\Diff\Renderer\Unified();
$renderer = new \MartynBiz\Diff\Renderer\Inline();

$diff = $renderer->render($check_diff);

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1a27a170ef279c7363e50281f05711095a652ec6489eb060872022a9887ce8a?d=identicon)[martynbiz](/maintainers/martynbiz)

---

Top Contributors

[![martynbiz](https://avatars.githubusercontent.com/u/6215352?v=4)](https://github.com/martynbiz "martynbiz (8 commits)")

### Embed Badge

![Health badge](/badges/martynbiz-diff/health.svg)

```
[![Health](https://phpackages.com/badges/martynbiz-diff/health.svg)](https://phpackages.com/packages/martynbiz-diff)
```

###  Alternatives

[himiklab/yii2-sortable-grid-view-widget

Sortable modification of standard Yii2 GridView widget

79361.2k7](/packages/himiklab-yii2-sortable-grid-view-widget)[nsavinov/nova-percent-field

A Laravel Nova field.

21280.0k](/packages/nsavinov-nova-percent-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
