[Support request] Warning: count(): Parameter must be an array or an object that implements Count

Home Forums Support [Support request] Warning: count(): Parameter must be an array or an object that implements Count

Home Forums Support Warning: count(): Parameter must be an array or an object that implements Count

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #483260
    Enrico

    Tested and it worked!

    Thanks a lot Tom!

    #483711
    Tom
    Lead Developer
    Lead Developer

    No problem! Thanks for reporting it! 🙂

    #483861
    John

    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?

    #483991
    Tom
    Lead Developer
    Lead Developer

    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).

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.