src/Pharaoh/PharDiff.php
public function listChecksums(string $algo = 'sha384'): int
    {
        list($pharA, $pharB) = $this->hashChildren(
            $algo,
            $this->phars[0]->tmp,
            $this->phars[1]->tmp
        );

        $diffs = 0;
        /** @var string $i */
        foreach (\array_keys($pharA) as $i) {
            if (isset($pharA[$i]) && isset($pharB[$i])) {
                // We are NOT concerned about local timing attacks.
                if ($pharA[$i] !== $pharB[$i]) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", $this->c['red'], $pharA[$i], $this->c[''],
                    "\t", $this->c['green'], $pharB[$i], $this->c[''],
                    "\n";
                } elseif (!empty($pharA[$i]) && empty($pharB[$i])) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", $this->c['red'], $pharA[$i], $this->c[''],
                    "\t", \str_repeat('-', \strlen($pharA[$i])),
                    "\n";
                } elseif (!empty($pharB[$i]) && empty($pharA[$i])) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", \str_repeat('-', \strlen($pharB[$i])),
                    "\t", $this->c['green'], $pharB[$i], $this->c[''],
                    "\n";
                }
            }
        }
        if ($diffs === 0) {
            if ($this->verbose) {
                echo 'No differences encountered.', PHP_EOL;
            }
            return 0;
        }
        return 1;
    }
public function listChecksums(string $algo = 'sha384'): int
    {
        list($pharA, $pharB) = $this->hashChildren(
            $algo,
            $this->phars[0]->tmp,
            $this->phars[1]->tmp
        );

        $diffs = 0;
        /** @var string $i */
        foreach (\array_keys($pharA) as $i) {
            if (isset($pharA[$i]) && isset($pharB[$i])) {
                // We are NOT concerned about local timing attacks.
                if ($pharA[$i] !== $pharB[$i]) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", $this->c['red'], $pharA[$i], $this->c[''],
                    "\t", $this->c['green'], $pharB[$i], $this->c[''],
                    "\n";
                } elseif (!empty($pharA[$i]) && empty($pharB[$i])) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", $this->c['red'], $pharA[$i], $this->c[''],
                    "\t", \str_repeat('-', \strlen($pharA[$i])),
                    "\n";
                } elseif (!empty($pharB[$i]) && empty($pharA[$i])) {
                    ++$diffs;
                    echo "\t", (string) $i,
                    "\n\t\t", \str_repeat('-', \strlen($pharB[$i])),
                    "\t", $this->c['green'], $pharB[$i], $this->c[''],
                    "\n";
                }
            }
        }
        if ($diffs === 0) {
            if ($this->verbose) {
                echo 'No differences encountered.', PHP_EOL;
            }
            return 0;
        }
        return 1;
    }
public function listChecksums ( string $ algo = 'sha384' ) : int { list ( $ pharA , $ pharB ) = $ this -> hashChildren ( $ algo , $ this -> phars [ 0 ] -> tmp , $ this -> phars [ 1 ] -> tmp ) ; $ diffs = 0 ; /** @var string $i */ foreach ( \ array_keys ( $ pharA ) as $ i ) { if ( isset ( $ pharA [ $ i ] ) && isset ( $ pharB [ $ i ] ) ) { // We are NOT concerned about local timing attacks. if ( $ pharA [ $ i ] !== $ pharB [ $ i ] ) { ++ $ diffs ; echo "\t" , ( string ) $ i , "\n\t\t" , $ this -> c [ 'red' ] , $ pharA [ $ i ] , $ this -> c [ '' ] , "\t" , $ this -> c [ 'green' ] , $ pharB [ $ i ] , $ this -> c [ '' ] , "\n" ; } elseif ( ! empty ( $ pharA [ $ i ] ) && empty ( $ pharB [ $ i ] ) ) { ++ $ diffs ; echo "\t" , ( string ) $ i , "\n\t\t" , $ this -> c [ 'red' ] , $ pharA [ $ i ] , $ this -> c [ '' ] , "\t" , \ str_repeat ( '-' , \ strlen ( $ pharA [ $ i ] ) ) , "\n" ; } elseif ( ! empty ( $ pharB [ $ i ] ) && empty ( $ pharA [ $ i ] ) ) { ++ $ diffs ; echo "\t" , ( string ) $ i , "\n\t\t" , \ str_repeat ( '-' , \ strlen ( $ pharB [ $ i ] ) ) , "\t" , $ this -> c [ 'green' ] , $ pharB [ $ i ] , $ this -> c [ '' ] , "\n" ; } } } if ( $ diffs === 0 ) { if ( $ this -> verbose ) { echo 'No differences encountered.' , PHP_EOL ; } return 0 ; } return 1 ; }
Prints out all of the differences of checksums of the files contained
in both PHP archives.

@param string $algo
@return int
@throws \SodiumException
Prints out all of the differences of checksums of the files contained in both PHP archives .