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 10y ago2 watchersCompare

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

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 22% 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

[jaybizzle/crawler-detect

CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent

2.3k96.7M215](/packages/jaybizzle-crawler-detect)

PHPackages © 2026

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