count(): Parameter must be an array or an object that implements Countable code example

Example 1: count() parameter must be an array or an object that implements countable laravel

//add a typecast array to the array being called
$count = count((array)$originalArray);

Example 2: The "chunk" argument must be one of type string or Buffer. Received type object nodejs

//change res.end() to res.send()

Example 3: mysql error count(): Parameter must be an array or an object that implements Countable

sudo sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php