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
Used Versions
PHP 7.2, Zend 3.0, Symfony 4.0, Laravel 5.6, PHPUnit 6.5, Doctrine 2.8