Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
673 views
in Themes by

After upgrading php from 7.0 to 7.2 it shows me the following message :

Warning: count(): Parameter must be an array or an object that implements Countable in \qa-theme\lion\core\Theme.php on line 457

Q2A version: 1.8.3

1 Answer

+1 vote
by
selected by
 
Best answer

These errors are quite normal due to the upgrade. Usually they happen because the variable expects to hold an array and it ends up holding a null value.

Probably you might want to first check if the variable is an array and then perform the actual action. E.G.:

if (is_array($variable) && count($variable) > 2) { ...
...