Count(): Parameter must be an array or an object that implements Countable – What’s wrong?

When you implement some task with your files on localhost with XAMPP environment, have you ever faced the error Count(): Parameter must be an array or an object that implements Countable? We can understand that this error appears since there is an issue with the parameter which is passed to the count function.

Don’t worry about that because in the blog today, we would like to bring you some suggested solutions that you can try to solve this trouble. So, let’s dig in now!

Count(): Parameter Must Be An Array Or An Object That Implements Countable

How to fix the error Count(): Parameter must be an array or an object that implements Countable

As you know, from PHP 7.2 version, there is a warning on invalid countable types that are passed to the array_or_countable parameter. Therefore, in order to deal with this issue, you need to follow one of the three methods below:

  • Go to your localhost with XAMPP -> access the line that occurs the error -> replace the code:

$fcount = count($rawnames);

into:

$fcount = (is_array($rawnames)) ? count($rawnames) : 0;

  • Use a previous version of PHP instead of PHP 7.2.
  • Get in touch with the plugin support and ask for their support to tackle the error.

Wrap up

All in all, that are 3 solutions you should try to address the error Count(): Parameter must be an array or an object that implements Countable. We hope that the methods above will work successfully to help you remove the error. Any other solution to this trouble? If yes, don’t forget to share it with us by leaving your comment below. We will appreciate this.

Last but not least, we are providing many high-quality and fully responsive Joomla 4 Templates and Free WordPress Themes, so don’t hesitate to visit our site and get the best one whenever you want. Thanks for your reading and have a great day.

5/5 - (1 vote)
Lt Digital Team (Content &Amp; Marketing)
Latest posts by LT Digital Team (Content & Marketing) (see all)
Summer Sale Grab 50% Off for everything on today, don't miss it. Coupon code: SUMMER2024 Redeem Now
🎃Spooktacular Halloween🎃 Deal! Grab 50% Off for everything on today, don't miss it. Coupon code: LTCOUPON50 Redeem Now