PHPackages                             paragonie/pharaoh - 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. paragonie/pharaoh

Abandoned → [humbug/box](/?search=humbug%2Fbox)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

paragonie/pharaoh
=================

Compare PHARs from the Command Line

v0.6.1(2y ago)37456.9k↑263.1%6MITPHPPHP ^7.1|^8

Since Apr 16Pushed 2y ago9 watchersCompare

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

READMEChangelog (9)Dependencies (4)Versions (9)Used By (0)

Pharaoh - PHAR diff utility
===========================

[](#pharaoh---phar-diff-utility)

> **Notice**: [Box](https://github.com/humbug/box) has a diff utility that does what Pharaoh set out to do, and is more widely supported and adopted. We are deprecating Pharaoh in favor of `box diff`.

[![Build Status](https://github.com/paragonie/pharaoh/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/pharaoh/actions)[![Latest Stable Version](https://camo.githubusercontent.com/f0ecf6f4e6234e45b5877cfccaf4a63e35025f5ee3b1c6ff541dafa92d7953df/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f70686172616f682f762f737461626c65)](https://packagist.org/packages/paragonie/pharaoh)[![Latest Unstable Version](https://camo.githubusercontent.com/15e817dff189c45a1e544d8260be59483e636962405590bcbb00fc6d6851ac6a/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f70686172616f682f762f756e737461626c65)](https://packagist.org/packages/paragonie/pharaoh)[![License](https://camo.githubusercontent.com/7a46de3bbfdb7991a2e9d1b96dfc4cd226d17ec7d2629d150b47158de1a366c5/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f70686172616f682f6c6963656e7365)](https://packagist.org/packages/paragonie/pharaoh)

Display the differences between all of the files in two PHP Archives.

In all likelihood, two PHP Archives will not be byte-for-byte compatible, so `sha256sum` will not yield the same result, even if they were both built from the same source code and contain the same contents. This is because Composer randomizes e.g. their autoloader class names.

Copyright (c) 2015 - 2018 [Paragon Initiative Enterprises](https://paragonie.com). Check out our other [open source projects](https://paragonie.com/projects) too.

Example
-------

[](#example)

To verify two PHP Archives were built from the same source code, first download the official distribution and then build a Phar from source.

### Basic Usage

[](#basic-usage)

To see what differs between the two files, run this command:

```
/path/to/pharaoh \
    /path/to/distributed.phar \
    /path/to/built-from-source-code.phar
```

Sample output:

```
$ pharaoh dist/sodium-compat-php5.phar dist/sodium-compat-php7.phar
diff --git a/tmp/phr_GPrhh5/vendor/autoload.php b/tmp/phr_SBYnr7/vendor/autoload.php
index c20d4db..5c849e0 100644
--- a/tmp/phr_GPrhh5/vendor/autoload.php
+++ b/tmp/phr_SBYnr7/vendor/autoload.php
@@ -4,4 +4,4 @@

 require_once __DIR__ . '/composer/autoload_real.php';

-return ComposerAutoloaderInitf6d95af9246e0e0e98e255e3bc14c82b::getLoader();
+return ComposerAutoloaderInitd4c7400998bd39c407a1d41a47cd86c6::getLoader();
diff --git a/tmp/phr_GPrhh5/vendor/composer/autoload_real.php b/tmp/phr_SBYnr7/vendor/composer/autoload_real.php
index a23d814..432c698 100644
--- a/tmp/phr_GPrhh5/vendor/composer/autoload_real.php
+++ b/tmp/phr_SBYnr7/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@

-class ComposerAutoloaderInitf6d95af9246e0e0e98e255e3bc14c82b
+class ComposerAutoloaderInitd4c7400998bd39c407a1d41a47cd86c6
 {
 private static $loader;

@@ -19,15 +19,15 @@ if (null !== self::$loader) {
 return self::$loader;
 }

-spl_autoload_register(array('ComposerAutoloaderInitf6d95af9246e0e0e98e255e3bc14c82b', 'loadClassLoader'), true, true);
+spl_autoload_register(array('ComposerAutoloaderInitd4c7400998bd39c407a1d41a47cd86c6', 'loadClassLoader'), true, true);
 self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-spl_autoload_unregister(array('ComposerAutoloaderInitf6d95af9246e0e0e98e255e3bc14c82b', 'loadClassLoader'));
+spl_autoload_unregister(array('ComposerAutoloaderInitd4c7400998bd39c407a1d41a47cd86c6', 'loadClassLoader'));

 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
 if ($useStaticLoader) {
 require_once __DIR__ . '/autoload_static.php';

-call_user_func(\Composer\Autoload\ComposerStaticInitf6d95af9246e0e0e98e255e3bc14c82b::getInitializer($loader));
+call_user_func(\Composer\Autoload\ComposerStaticInitd4c7400998bd39c407a1d41a47cd86c6::getInitializer($loader));
 } else {
 $map = require __DIR__ . '/autoload_namespaces.php';
 foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ $loader->addClassMap($classMap);
 $loader->register(true);

 if ($useStaticLoader) {
-$includeFiles = Composer\Autoload\ComposerStaticInitf6d95af9246e0e0e98e255e3bc14c82b::$files;
+$includeFiles = Composer\Autoload\ComposerStaticInitd4c7400998bd39c407a1d41a47cd86c6::$files;
 } else {
 $includeFiles = require __DIR__ . '/autoload_files.php';
 }
 foreach ($includeFiles as $fileIdentifier => $file) {
-composerRequiref6d95af9246e0e0e98e255e3bc14c82b($fileIdentifier, $file);
+composerRequired4c7400998bd39c407a1d41a47cd86c6($fileIdentifier, $file);
 }

 return $loader;
 }
 }

-function composerRequiref6d95af9246e0e0e98e255e3bc14c82b($fileIdentifier, $file)
+function composerRequired4c7400998bd39c407a1d41a47cd86c6($fileIdentifier, $file)
 {
 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
 require $file;
diff --git a/tmp/phr_GPrhh5/vendor/composer/autoload_static.php b/tmp/phr_SBYnr7/vendor/composer/autoload_static.php
index d10ce9b..55ba104 100644
--- a/tmp/phr_GPrhh5/vendor/composer/autoload_static.php
+++ b/tmp/phr_SBYnr7/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@

 namespace Composer\Autoload;

-class ComposerStaticInitf6d95af9246e0e0e98e255e3bc14c82b
+class ComposerStaticInitd4c7400998bd39c407a1d41a47cd86c6
 {
 public static $files = array (
 '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
```

### GNU diffs (`-d`)

[](#gnu-diffs--d)

By default, Pharaoh will use `git` to generate a diff of the code. If you'd prefer a GNU diff, pass the `-d` flag, like so:

```
/path/to/pharaoh -d \
    /path/to/distributed.phar \
    /path/to/built-from-source-code.phar
```

Sample output:

```
$ pharaoh -d dist/sodium-compat-php5.phar dist/sodium-compat-php7.phar
Common subdirectories: /tmp/phr_EsTl2p/lib and /tmp/phr_UV3iJt/lib
Common subdirectories: /tmp/phr_EsTl2p/src and /tmp/phr_UV3iJt/src
Common subdirectories: /tmp/phr_EsTl2p/vendor and /tmp/phr_UV3iJt/vendor
```

### File hashes (`-c`, `--check`)

[](#file-hashes--c---check)

If you're more interested in verifying the authenticity of a Pharaoh's contents from a quick scan, you can use the `-c algo` or `--check=algo` arguments to specify the hash function to use.

```
/path/to/pharaoh --check=sha256 \
    /path/to/distributed.phar \
    /path/to/built-from-source-code.phar

# This is equivalent to the above command:
/path/to/pharaoh -csha256 \
    /path/to/distributed.phar \
    /path/to/built-from-source-code.phar
```

Sample output:

```
$ pharaoh --check=blake2b dist/sodium-compat-php5.phar dist/sodium-compat-php7.phar
	/vendor/autoload.php
		83d3edc0cc50bbe1d4a05ec1c269359b1eddeb0d7d706f81c7bfb52e7a2dd86c	3310968acbf487a14e38e55077cf792bcd649f48e001717a35506f12031c97a9
	/vendor/composer/autoload_static.php
		a3e53155cbc5faccc2f8bb1d28dfe202ac033504d0e72268847bf33429bb47df	da215e6479739f87f04248880d0bfee78bd5d0828e61c8fb38a85902d42e844c
	/vendor/composer/autoload_real.php
		70e1113f73dc73a61594ee5cb724c44019f8f1a79321e51532a3cf0ef582b50c	1fd1127fb6a245128b5901f5d1087a1fbe0477e525d477192bd91a7623cf152a

```

All hash functions supported by PHP are accepted here. Additionally, if you specify `blake2b`, Pharaoh will use [sodium\_compat](https://github.com/paragonie/sodium_compat) to generate a BLAKE2b hash of each file.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~543 days

Total

8

Last Release

740d ago

PHP version history (3 changes)v0.3.0PHP ^7

v0.6.0PHP ^7|^8

v0.6.1PHP ^7.1|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/05d241256cda885139a5697d3bb536b5cec3b430c1adb9c524bf92a37a55758d?d=identicon)[paragonie-scott](/maintainers/paragonie-scott)

---

Top Contributors

[![paragonie-security](https://avatars.githubusercontent.com/u/15914520?v=4)](https://github.com/paragonie-security "paragonie-security (18 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (16 commits)")[![theofidry](https://avatars.githubusercontent.com/u/5175937?v=4)](https://github.com/theofidry "theofidry (5 commits)")[![sarciszewski](https://avatars.githubusercontent.com/u/3710836?v=4)](https://github.com/sarciszewski "sarciszewski (2 commits)")[![villfa](https://avatars.githubusercontent.com/u/2891564?v=4)](https://github.com/villfa "villfa (1 commits)")

---

Tags

diffutilitypharsecuritytoolauditing

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/paragonie-pharaoh/health.svg)

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[seld/phar-utils

PHAR file format utilities, for when PHP phars you up

875180.0M32](/packages/seld-phar-utils)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21320.9M15](/packages/caxy-php-htmldiff)[phpcsstandards/phpcsutils

A suite of utility functions for use with PHP\_CodeSniffer

6333.4M58](/packages/phpcsstandards-phpcsutils)[localheinz/diff

Fork of sebastian/diff for use with ergebnis/composer-normalize

4737.0M5](/packages/localheinz-diff)

PHPackages © 2026

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