Compare two results and show difference like in PHPUnit

Code
<?php

use SebastianBergmann\Diff\Differ;

$differ = new Differ();

$val1 "1\n2\n3\n4";
$val2 "1\n2\n5\n4";

echo 
$differ->diff($val1$val2);
Result
--- Original
+++ New
@@ @@
1
2
-3
+5
4
Used Versions
PHP 7.3, Zend 3.0, Symfony 4.3, Laravel 5.8, PHPUnit 8.0, Doctrine 2.10