Warning: count(): Parameter must be an array or an object that implements Countable in line 302解决方法
ytkah在调试项目时又弹出一个警告Warning: count(): Parameter must be an array or an object that implements Countable in line 302,count()参数必须是一个数组或一个对象,和前面warning: a non-numeric value encountered in line错误类似,都是php7版本引起的,版本更新,部分方法变得更加严谨了 当传递一个无效参数的时候,count()函数会抛出warning的警告
既然提示count()参数必须是一个数组或一个对象,那我们就直接将它设为数组试试,原来302行代码是这样的
if (count($tombstones) > 0) :
我们把它改成
if (count((array)$tombstones) > 0) :
保存上传,清除缓存,刷新页面,错误提示消失了。
做开发还是要会一点英语比较好,不然文档看半天不知所云,有时翻译又牛头不对马嘴,还有国外的StackOverflow很强大,建议收藏!
Warning: count(): Parameter must be an array or an object that implements Countable in line 302解决方法的更多相关文章
- warning: a non-numeric value encountered in line *的解决方法
今天ytkah在调试项目的时候出现了一个警告warning: a non-numeric value encountered in line 694,查看php官方文档,上面解释说在使用(+ - * ...
- 执行make出现“Warning: File `xxx.c' has modification time 2.6e+04 s in the future“警告的解决方法
错误描述: 执行make命令时出现"make[2]: Warning: File `xxx.c' has modification time 1.6e+05 s in the future ...
- warning: LF will be replaced by CRLF in application.yml. The file will have its origina解决方法
环境: windows提交时报错如图所示: 原因是存在符号转义问题 windows中的换行符为 CRLF, 而在linux下的换行符为LF,所以在执行add . 时出现提示,解决办法: git con ...
- Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 26
可参考上篇文章 链接 PHP数组简写模式 同样是PHP版本问题:in_array()函数 第二个参数应该为数组 但是 lnmp下,PHP5.3不报错,wamp下PHP5.5报以下错误: echo & ...
- swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter.
'swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character ...
- Centos 7 mysql Buffered warning: Changed limits: max_connections: 214 解决方法
Everytime I restart MySQL I have this warning: [Warning] Buffered warning: Changed limits: max_conne ...
- 【svn】SSL error: A TLS warning alert has been received的解决方法
第一次用svn(>_<),结果在运行下面语句时,svn很不友好的报错了..... svn co http:10.11.12.13/test1/test2 . 报错信息: svn: OPTI ...
- 阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决方法
阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决 ...
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
这篇文章主要介绍了PHP错误Warning: Cannot modify header information - headers already sent by解决方法,需要的朋友可以参考下 今天在 ...
随机推荐
- sublime自动保存设置
首选项——用户设置 (Preferences:Settings - User) 行末添加"save_on_focus_lost": true 注意用逗号分隔 保存即可 save_o ...
- CentOS7中MariaDB重置密码
虚拟机里的MariaDB忘记密码了,连接不上,只能重置MariaDB的密码,步骤参考网络 [root@localhost ~]# mysql -uroot -p Enter password: ERR ...
- 【异常处理】Java异常如何做异常处理
类似SpringMVC项目的异常处理可以这样做: 整个项目创建全局的: 1.一个自定义异常如OneException和错误码,统一封装所有异常. 2.一个返回实体类ResponseEntity,包含返 ...
- win7下安装linux(centos6.5)双系统详细小白教程
在正式介绍linux安装教程之前,先声明一下本人也是刚开始接触linux,所以教程只以成功安装linux为目标,里面的具体步骤我都是参考网上的教程自己操作实现的,至于为什么要这么做就不多做解释,大家想 ...
- SpringBoot 多数据源分布式事务
1.pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...
- Navicat for MySQL 连接Mysql8.0 报 1251
先设置Mysql全局 cmd下输入: mysql -uroot -p root密码 use mysql; update user set host = "%" where user ...
- Linux环境搭建 | 手把手教你如何安装CentOS7虚拟机
centos 下载地址: 可以去官网下载最新版本:https://www.centos.org/download/ 以下针对各个版本的ISO镜像文件,进行一一说明: CentOS-7.0-x86_64 ...
- antd中按需加载使用react-app-rewired报错
[描述] 按照antd官网步骤 https://ant.design/docs/react/use-with-create-react-app-cn 最后yarn start会报错 [解决方法] 原因 ...
- 【Vue】-- 数据双向绑定的原理 --Object.defineProperty()
Object.defineProperty()方法被许多现代前端框架(如Vue.js,React.js)用于数据双向绑定的实现,当我们在框架Model层设置data时,框架将会通过Object.def ...
- centos6.5安装nginx+python+uwsgi+django
nginx+uwsgi+django环境部署及测试 默认系统自带的python2.6.6 第一步(安装setuptools) wget https://pypi.python.org/packages ...