caxy / php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML. Includes support for comparing complex lists and tables
http://php-htmldiff.caxy.com
GNU General Public License v2.0
202 stars 51 forks source link

Fix reserved keyword match in PHP 8.0 #92

Closed iluuu1994 closed 3 years ago

iluuu1994 commented 4 years ago

Note this currently breaks Psalm/PHPStan, even though PHP 8.0 is still months away from releasing.

ossobuffo commented 3 years ago

8.0.0 is now stable, so this issue is now more pressing.

ossobuffo commented 3 years ago

At first I was skeptical about renaming Match as Match_, but I see that is what was done in nikic/php-parser as well.

SavageTiger commented 3 years ago

I would not rename this class to Match_, there really is no reason todo so.

A better solution would be to give it a more specific name, the fact that it now clashes with an operator name should already be a smell that it is not specific enough.

For example, why don't we call this DifferenceMatch?

SavageTiger commented 3 years ago

This issue is fixed when https://github.com/caxy/php-htmldiff/pull/93 is merged.

SavageTiger commented 3 years ago

This has been fixed in version v0.1.10