Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Abe2021 opened this issue Sep 17, 2021 · 1 comment

Comments

@Abe2021
Copy link

Abe2021 commented Sep 17, 2021

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

@a4992214
Copy link

a4992214 commented Jun 5, 2023

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants