Archived topic
Warning: count(): Parameter must be an array or an object that implements Count
18 replies · Started by John on October 5, 2017
Tested and it worked!
Thanks a lot Tom!
No problem! Thanks for reporting it! :)
This may not be relevant, but PHP 7.2 error handling is different from PHP 7.1.
PHP 7.2 will issue a warning for an attempt to count a non-countable type.
From
http://php.net/manual/en/migration72.incompatible.php
Migrating PHP 7.1x to PHP7.2x
Backward incompatible changes
{begin quote}
Warn when counting non-countable types
An E_WARNING will now be emitted when attempting to count() non-countable types (this includes the sizeof() alias function).
The above example will output:
Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
{end quote}
I noticed on Jan 22, 2018, Tom posted that the development server was updated to to PHP 7.2. However, even with PHP 7.2 the error was not reproduced.
Is it a PHP 7.1 vs PHP 7.2 change?
I do believe it's a 7.1 vs 7.2 change in PHP. I couldn't reproduce the issue because I was using the GPP 1.6 branch, which had the issue fixed (not on purpose).