PHPackages                             kipras/array-diff-html - 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. kipras/array-diff-html

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

kipras/array-diff-html
======================

PHP class for pretty-printing the difference between two arrays/objects

v1.3(11y ago)271MITPHPPHP &gt;=5.3.0

Since Aug 8Pushed 11y ago2 watchersCompare

[ Source](https://github.com/kipras/ArrayDiffHtml)[ Packagist](https://packagist.org/packages/kipras/array-diff-html)[ Docs](http://github.com/kipras/ArrayDiffHtml)[ RSS](/packages/kipras-array-diff-html/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (5)Used By (0)

ArrayDiffHtml
=============

[](#arraydiffhtml)

PHP class for pretty-printing the difference between two arrays/objects using HTML, CSS and JavaScript, providing buttons to expand/collapse each level.

Example screenshot:
[![ArrayDiffHtml screenshot](https://camo.githubusercontent.com/21f3246306682740790c8831ac5d612af0ac0f79fd31e7adfbeb036bdcf9e886/687474703a2f2f7777772e6b69707261732e636f6d2f6b69707261735f6c6962732f41727261794469666648746d6c2e706e67)](https://camo.githubusercontent.com/21f3246306682740790c8831ac5d612af0ac0f79fd31e7adfbeb036bdcf9e886/687474703a2f2f7777772e6b69707261732e636f6d2f6b69707261735f6c6962732f41727261794469666648746d6c2e706e67)

Any objects found along the way are converted to arrays, in one of these ways (they are tried in this order):

- If a global function `toArray()` exists - that function is called and the result of it is used for comparison
- If the object has a method `_toArray()` - that method is called and the result of it is used for comparison
- Otherwise `get_object_vars()` is called to retrieve data from the object

Usage
-----

[](#usage)

- **ArrayDiffHtml::diff($first, $second, \[$strictEquality\], \[$opt\])**

    Options can be passed as an associative array in the $opt parameter.
    Available options:

    - `title1`: Title of the `$first1` array (default = *'First'*)
    - `title2`: Title of the `$second` array (default = *'Second'*)
    - `noSecond`: If there is no second array (we are only printing the contents of the first array and no comparison should be done) - this should be set to *`True`*. (default = *False*)

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

[](#requirements)

- PHP &gt;= 5.3 (uses `static::` keyword)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

4301d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1502290?v=4)[Kipras Mancevičius](/maintainers/kipras)[@kipras](https://github.com/kipras)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/kipras-array-diff-html/health.svg)

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

PHPackages © 2026

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