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解决方法,需要的朋友可以参考下 今天在 ...
随机推荐
- PHP输出缓存ob系列函数
ob,输出缓冲区,是output buffering的简称,而不是output cache.ob用对了,是能对速度有一定的帮助,但是盲目的加上ob函数,只会增加CPU额外的负担. ob的基本原则:如果 ...
- LINUX常见性能监控工具总结
文章来源 工具功能概览 整理了一个关于监控工具及其功能的表.下面对这些工具单独详细介绍. Linux性能监控工具 top top命令会展示进程的实际活动.默认情况下,它会列出系统上所有cpu密集型任务 ...
- 不装插件,查看.rp文件
AxShare国内平台地址:http://share.axure.org临时急用可以使用公用帐户.用户名:axure@webppd.com,密码:webppd123 上传.rp文件,点击 url 地址 ...
- 【java】-- java并发包总结
1.同步容器类 1.1.Vector与ArrayList异同 1.Arraylist和Vector都是采用数组方式存储数据,都允许直接序号索引元素,所以查找速度快,但是插入数据等操作涉及到数组元素移动 ...
- ISP PIPLINE (五) Denoise
what is the Denoise? Denoise就是图像去噪,平滑图像,并保留图像细节. why does Denoise? 图像在采集并转换为数字信号的过程会引入一些噪声,这些噪声会让图片看 ...
- 关于Function Language(函数式语言是什么?包含哪些语言?为什么函数式语言流行?)
1.What? Function Language是一种非冯诺依曼式的程序设计语言.函数式语言的主要成分是原始函数.定义函数和函数型. 这种语言具有较强的组织数据结构的能力,可以把某一数据结构(如数组 ...
- 潭州课堂25班:Ph201805201 tornado 项目 第六课 用户和图片分享的集成(课堂笔记)
tornado 相关说明 改善图片上传功能 ,生成唯一的 ID ,与路径拼接,生成 URL, 这里引用 uuid 的 python 库 在 photo.py 中创建个类,用来 辅助用户上传的图片,生 ...
- XIV Open Cup named after E.V. Pankratiev. GP of America
A. Ancient Diplomacy 建图,同色点间边权为$0$,异色点间边权为$1$,则等价于找一个点使得到它最短路最长的点的最短路最小,Floyd即可. 时间复杂度$O(n^3)$. #inc ...
- select应用
服务端源码 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun "& ...
- haskell实现简易计算器
> module Main where > import System.IO > import Data.Char > import Control.Monad > im ...