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?