Skip to content

Fix PHP 7.3 warning when using count() on non-array value #171

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

Merged

Conversation

westonruter
Copy link
Collaborator

A PHP warning is being raised in PHP 7.3:

PHP Warning: count(): Parameter must be an array or an object that implements Countable in .../sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/ParserState.php on line 30

This was reported a couple times in the context of the AMP plugin for WordPress:

The suggested fix is to ensure that count() is only being done with aText when it has been populated with an array value.

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

Successfully merging this pull request may close these issues.

2 participants