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解决方法,需要的朋友可以参考下 今天在 ...
随机推荐
- liunx redis集群添加密码
第一种方法: 修改每个节点redis.conf配置文件: masterauth 123456 requirepass 123456 各个节点的密码都必须一致,否则Redirected就会失败 重新启动 ...
- 【web】服务器推送的实现方式(转)
轮询 http流 websocket https://www.cnblogs.com/freud/p/8397934.html http2.0 浅谈Websocket.Ajax轮询和长连接(lon ...
- 剑指offer数组3
面试题11:旋转数组的最小数字 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转. 输入一个非减排序的数组的一个旋转,输出旋转数组的最小元素. 例如数组{3,4,5,1,2}为{1,2 ...
- 小程序 -- ui布局
Flex布局 相对定位和绝对定位 弹性盒模型 display flex-direction flex-wrap :nowrap(不换行)/ wrap(换行,第一行在上方)/ wrap-reverse ...
- Java Web项目漏洞:检测到目标URL存在http host头攻击漏洞解决办法
检测到目标URL存在http host头攻击漏洞 详细描述 为了方便的获得网站域名,开发人员一般依赖于HTTP Host header.例如,在php里用_SERVER["HTTP_HOST ...
- windows上下载redis扩展
关于windows电脑上下载redis扩展,网站一搜一大把,但是我相信有很多小伙伴还是不知道这个扩展到底怎么下载.好了,现在我就用通俗易懂的话来告诉大家怎么下载安装这个redis扩展. 1.首先我们先 ...
- python设计模式---创建型之工厂模式
# coding = utf-8 from abc import ABCMeta, abstractmethod # 简单工厂模式 class Animal(metaclass=ABCMeta): @ ...
- HDU 5977 Garden of Eden
题解: 路径统计比较容易想到点分治和dp dp的话是f[i][j]表示以i为根,取了i,颜色数状态为j的方案数 但是转移这里如果暴力转移就是$(2^k)^2$了 于是用FWT优化集合或 另外http: ...
- mysql命令之工作小结
1.登客户端 mysql -u userName -p password -h ip 注:u 用户名 p 密码 h ip地址 2.修改密码 UPDATE mysql.u ...
- python基础篇_006_面向对象
面向对象 1.初识类: # 定义一个函数,我们使用关键字 def """ def 函数名(参数): '''函数说明''' 函数体 return 返回值 "&qu ...