PHPackages                             foreachq/gendiff - 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. foreachq/gendiff

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

foreachq/gendiff
================

Structure differences finder

v1.1(4y ago)05proprietaryPHP

Since Feb 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Foreachq/gendiff)[ Packagist](https://packagist.org/packages/foreachq/gendiff)[ RSS](/packages/foreachq-gendiff/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

[![PHP CI](https://github.com/ForeachQ/gendiff/actions/workflows/php-ci.yml/badge.svg)](https://github.com/ForeachQ/gendiff/actions/workflows/php-ci.yml)[![](https://camo.githubusercontent.com/9a39597ad5c757e907a561cfb0c60ce0d4f286db4c86314103615231b5f28877/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61313736636330613764356435636431616166332f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/ForeachQ/gendiff/maintainability)[![](https://camo.githubusercontent.com/2dda8014488c3b570a8d4899d958dc9c0b16dca249d758eed8f73d5272ca332f/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61313736636330613764356435636431616166332f746573745f636f766572616765)](https://codeclimate.com/github/ForeachQ/gendiff/test_coverage)

Gendiff
=======

[](#gendiff)

«Gendiff» — a program that finds the difference between two data structures.

Description
-----------

[](#description)

Can be used as a separate CLI application or imported as a php package.

Program gets 2 paths and output format as input and returns structures differences in user defined format.

Utility features:

- Recursive processing;
- Support for different input formats: yaml and json;
- Report generation in the form of plain text, "stylish" and json.

Requirements
------------

[](#requirements)

- php 7.4
- composer 2.\*

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

[](#installation)

### Php package

[](#php-package)

```
composer require foreachq/gendiff
```

### Cli application

[](#cli-application)

- Download package

```
composer create-project foreachq/gendiff
```

- Install dependencies

```
make install

```

Usage
-----

[](#usage)

### CLI

[](#cli)

```
# format plain
$ ./gendiff --format plain path/to/file.yml another/path/file.json

Property 'common.follow' was added with value: false
Property 'group1.baz' was updated. From 'bas' to 'bars'
Property 'group2' was removed

# format by default (stylish)
$ ./gendiff filepath1.json filepath2.json

{
  + follow: false
    setting1: Value 1
  - setting2: 200
  - setting3: true
  + setting3: {
        key: value
    }
  + setting4: blah blah
  + setting5: {
        key5: value5
    }
}

$ ./gendiff -h # for help
```

### Php package

[](#php-package-1)

```
use function Differ\Differ\genDiff;

// formats: stylish (default), plain, json
$diff = genDiff($pathToFile1, $pathToFile2, $format);
print_r($diff);
```

Asciinemas of usage
-------------------

[](#asciinemas-of-usage)

- [gendiff-stylish](https://asciinema.org/a/469671)
- [gendiff-plain](https://asciinema.org/a/469672)
- [gendiff-json](https://asciinema.org/a/469673)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~22 days

Total

2

Last Release

1528d ago

### Community

Maintainers

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

---

Top Contributors

[![ihalavin](https://avatars.githubusercontent.com/u/81471488?v=4)](https://github.com/ihalavin "ihalavin (50 commits)")

---

Tags

data-structuresphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/foreachq-gendiff/health.svg)

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

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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