php-htmldiff icon indicating copy to clipboard operation
php-htmldiff copied to clipboard

Warning: count(): Parameter must be an array or an object that implements Countable .....

Open Abe2021 opened this issue 4 years ago • 1 comments

When running demo/index.php I see the following errors (multiple times):

Warning: count(): Parameter must be an array or an object that implements Countable in C:.....\vendor\php-htmldiff-master\HtmlDiff.php on line 360

Warning: count(): Parameter must be an array or an object that implements Countable in C:.....\vendor\php-htmldiff-master\HtmlDiff.php on line 266

wamp PHP Version 7.3.12

Abe2021 avatar Sep 17 '21 14:09 Abe2021

This can be fixed changing line 266 from

if( count( $words ) == 0 && count( $specialCaseTagInjection ) == 0 ) {
    break;
}

to

if( $words && count( $words ) == 0 && $specialCaseTagInjection && count( $specialCaseTagInjection ) == 0 ) {
    break;
}

a4992214 avatar Jun 05 '23 13:06 a4992214