energy/diff

Compare files with Diff class

Maintainers

Package info

github.com/energy-coresky/diff

Homepage

pkg:composer/energy/diff

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1 2024-12-15 09:00 UTC

This package is auto-updated.

Last update: 2026-03-15 11:54:40 UTC


README

This is a most little working Diff..

<?php

require 'vendor/autoload.php';

$new = file_get_contents('new');
[$diff, $add, $sub] = Diff::diffx($new, file_get_contents('old'));

echo $sub ? "@@ -$sub" : '@@ ',
    $add ? "+$add @@" : ' @@', "\n", $diff;