sebastianbergmann / diff

Diff implementation
BSD 3-Clause "New" or "Revised" License
7.58k stars 85 forks source link

README example does not work #125

Closed 8ctopus closed 3 months ago

8ctopus commented 3 months ago

Good morning,

I just started exploring the package and found out the main simple example doesn't work because the constructor now requires the DiffOutputBuilderInterface.


use SebastianBergmann\Diff\Differ;

$differ = new Differ;
print $differ->diff('foo', 'bar');

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SebastianBergmann\Diff\Differ::__construct(), 0 passed in K:\dev\web\wp-cron\compare.php on line 9 and exactly 1 expected in K:\dev\web\wp-cron\vendor\sebastian\diff\src\Differ.php:40 Stack trace:

0 K:\dev\web\wp-cron\compare.php(9): SebastianBergmann\Diff\Differ->__construct()

1 {main}

thrown in K:\dev\web\wp-cron\vendor\sebastian\diff\src\Differ.php on line 40