-
Notifications
You must be signed in to change notification settings - Fork 35
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
PHP 7.3: "Parameter must be an array or an object that implements Countable" #218
Comments
Changing the line |
Can you send a pull request? |
Okay, I did. Just am not completely sure if that is all there is to it, just my particular use-case does not print a warning anymore. Oh, and it seems Travis CI fails for all 7.x PHP versions. But not showing what exactly fails, which lines of code are wrong. I suspect it might be just because of other similar cases where some instructions were too laissez-faire for PHP 7.x. |
Had the same issue with the discussions plugin - line 425 in action.php (docuwiki/lib/plugins/discussion) is changed to:
|
Same story here. Waiting for a verified solution. The workaround above is welcome. |
Hello!
Since upgrading a server to PHP 7.3 (only from PHP 7.1 I believe?) there appear now warning messages
for adminsnot only for admins, apparently stemming from code in the Data plugin:Warning: count(): Parameter must be an array or an object that implements Countable in /xxx/yyy/zzz/lib/plugins/data/syntax/entry.php on line 168
I am not an expert in PHP and the new stricter type checks that seems to have been introduced. But here is the code where it happens:
Not sure what this $data array contains, but it seems PHP 7.3. is warning that it may be of some type for which
count(...)
is not applicable.Probably this is just one small instance of possibly more scenarios where PHP 7.3 does some stricter checking than previous PHP versions.
Since it's only putting out "warning", I assume that nothing is really broken by it. But it might be worthwhile to see how to satisfy PHP 7.3 overall.
The text was updated successfully, but these errors were encountered: