PHP提示:Warning: count():Parameter must be an array or an object that implements Countable错误的原因及解决办法 0 By 董德多 on 2021年3月10日 PHP 报错信息:Warning: count(): Parameter must be an array or an object that implements Countable 错误原因:PHP7.2版本之后,count()函数的参数无效时会抛出该warning警告。 解决办法 1.简单粗暴的方法降级PHP版本。 2.如果是使用laravel框架报错的话,composer update一下就可以修复了。 3.检查count函数的参数,对参数做好校验判断预防报错。 array count parameter warning