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!
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);
$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.
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.
- Object of class stdclass could not be converted to string - September 21, 2022
- Curl: (6) could not resolve host - September 19, 2022
- Gutenberg vs Beaver Builder: Which is Better Page Builder? - September 14, 2022