php-diff
php-diff copied to clipboard
Return associative php array in DiffHelper::calculate
Currently, one has to use json_decode(
Currently, one has to use json_decode() to access diff properties.
Because it's not a design goal. If you want that rather than rendered diff, you probably just use https://github.com/jfcherng/php-sequence-matcher . This lib is based on that too.
I don't have an idea how it could be done beautifully, since a renderer is required to return a string by design.
You may use the getChanges() method of any HTML renderer to get the diff in php array.