energy/diff

Compare files with Diff class

1.1 2024-12-15 09:00 UTC

This package is auto-updated.

Last update: 2024-12-15 09:09:54 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;