New version 7.2 of PHP is little bit restrict for calling functions and passing parameters, now count() function will only count variable and it will thrown an error when parameter is not array.
Here is quick fix I have create my own function for counting array or object and it that function will return 0 if parameter contains string or anything else.
Alternate count function for php 7.2+
function fixed_count($array_obj){ if(!is_array($array_obj)){ $array_obj = (array) $array_obj; } try{ return count($array_obj); } catch(Exception $exc){ //for laravel add back slash \ before Exception eg: (\Exception) return 0; } }
Now just you have add that function your project library or project helper and find count( function and replace with fixed_count(
Enjoy!