Fixes count() NULL bug for SequenceMatcher.php#1665
Conversation
PHP 7.2 is stricter about invoking count() with parameters which are not countable: https://secure.php.net/manual/en/migration72.incompatible.php This case is triggered in SequenceMatcher, for example when reviewing a initial history entry of a host template: count(): Parameter must be an array or an object that implements Countable (SequenceMatcher.php:352) I fixed this like in #1458. Signed-off-by: phreeek <root@phreeek.de>
|
Thanks, @phreeek! This should definitively be fixed. It's vendored code, so before touching it I'd love to get a better understanding of what's going wrong. To me the main error here is that something changes these properties to a non-array, and I haven't been able to see where this should take place. Did you dig deeper into that class? Does "reviewing the initial history" mean it should happen all the times I click on the History Tab of a newly created Host Template? |
|
ping |
|
Fortunately there's already a PR addressing this: chrisboulton/php-diff#50 Unfortunately the lib seems not to be maintained: chrisboulton/php-diff#53 Maybe we should consider switching the lib? |
|
This has been fixed with 525b316 for v1.5.0. I guess @phreeek (user no longer exists) was testing with 1.4 and I wasn't able to understand why this patch should be required on the master branch at that time. Got no feedback, the PR you linked has been applied more than two years ago, we can close this. |
|
If you are still using this. I maintain the successor repo https://github.com/JBlond/php-diff |
PHP 7.2 is stricter about invoking count() with parameters which are not countable:
https://secure.php.net/manual/en/migration72.incompatible.php
This case is triggered in SequenceMatcher, for example when reviewing
a initial history entry of a host template:
I fixed this like in #1458.
Signed-off-by: phreeek root@phreeek.de