PHPackages                             acedude/finediff - 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. acedude/finediff

ActiveLibrary

acedude/finediff
================

PHP implementation of a Fine granularity Diff engine

0.3.1.5(10y ago)0439MITPHPPHP &gt;=5.3.0

Since Mar 14Pushed 10y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (10)Used By (0)

FineDiff
========

[](#finediff)

Originally written by Raymond Hill () FineDiff has been tweaked to bring it up to date with the modern world. That means documented, nicely formatted, tested code that can be easily extended.

[![Build Status](https://camo.githubusercontent.com/37fe48fb4f1c8d4832319e3763c4b77bc4ef263a5ce19a994711a2889e9c2058/68747470733a2f2f7472617669732d63692e6f72672f636f67706f77657265642f46696e65446966662e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/cogpowered/FineDiff)

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

[](#installation)

**Composer**

The preferred way of using FineDiff is through [Composer](http://getcomposer.org).

Add the following to your composer.json file:

```
{
    "require": {
        "cogpowered/finediff": "0.3.*"
    }
}
```

Upgrading
---------

[](#upgrading)

**0.3.x** introduces a backwards incompatible version, so if you have stored opcodes do not upgrade!

`0.3.x` fixes a double encoding issue that generates a longer opcode than is needed.

Usage
-----

[](#usage)

**Render HTML**

Render as HTML the difference between two strings:

```
$diff = new cogpowered\FineDiff\Diff;
echo $diff->render('string one', 'string two');
```

This would then output:

```
string twone
```

You could change the granularity to `cogpowered\FineDiff\Granularity\Word` so the output is:

```
string onetwo
```

You do this by passing it into the Diff constructor:

```
$granularity = new cogpowered\FineDiff\Granularity\Word;
$diff        = new cogpowered\FineDiff\Diff($granularity);
```

**Grab opcode instructions**

Opcode instructions are what tell FineDiff how to change one string into another.

```
$diff = new cogpowered\FineDiff\Diff;
echo $diff->getOpcodes('string one', 'string two');
```

This would then output:

```
c7d3i3:two
```

Render text using the opcodes:

```
$render = new cogpowered\FineDiff\Render\Text;
echo $render->process('string one', 'c7d3i3:two');
```

Would output:

```
string two
```

Same with HTML:

```
$render = new cogpowered\FineDiff\Render\Html;
echo $render->process('string one', 'c7d3i3:two');
```

License
-------

[](#license)

Copyright (c) 2011 Raymond Hill () Copyright (c) 2013 Rob Crowe ()

Licensed under The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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.

###  Release Activity

Cadence

Every ~111 days

Recently: every ~0 days

Total

9

Last Release

3924d ago

### Community

Maintainers

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

---

Top Contributors

[![acedude](https://avatars.githubusercontent.com/u/2816665?v=4)](https://github.com/acedude "acedude (7 commits)")

---

Tags

diffstringtextfinediffopcode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/acedude-finediff/health.svg)

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

###  Alternatives

[lolli42/finediff

PHP implementation of a Fine granularity Diff engine

138.8M3](/packages/lolli42-finediff)[d4h/finediff

PHP implementation of a Fine granularity Diff engine

141.3M1](/packages/d4h-finediff)[creof/wkb-parser

Parser for well-known binary (WKB/EWKB) object data

615.1M16](/packages/creof-wkb-parser)[creof/geo-parser

Parser for geography coordinate strings

624.4M15](/packages/creof-geo-parser)[creof/wkt-parser

Parser for well-known text (WKT) object strings

554.8M16](/packages/creof-wkt-parser)[vria/nodiacritic

Tiny helper function that removes all diacritical signs from characters

113.1M13](/packages/vria-nodiacritic)

PHPackages © 2026

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