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解决方法的更多相关文章

  1. warning: a non-numeric value encountered in line *的解决方法

    今天ytkah在调试项目的时候出现了一个警告warning: a non-numeric value encountered in line 694,查看php官方文档,上面解释说在使用(+ - * ...

  2. 执行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 ...

  3. warning: LF will be replaced by CRLF in application.yml. The file will have its origina解决方法

    环境: windows提交时报错如图所示: 原因是存在符号转义问题 windows中的换行符为 CRLF, 而在linux下的换行符为LF,所以在执行add . 时出现提示,解决办法: git con ...

  4. 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 & ...

  5. 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 ...

  6. 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 ...

  7. 【svn】SSL error: A TLS warning alert has been received的解决方法

    第一次用svn(>_<),结果在运行下面语句时,svn很不友好的报错了..... svn co http:10.11.12.13/test1/test2 . 报错信息: svn: OPTI ...

  8. 阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决方法

    阿里云服务器出现Warning: Cannot modify header information - headers already sent by (output started at 问题的解决 ...

  9. PHP错误Warning: Cannot modify header information - headers already sent by解决方法

    这篇文章主要介绍了PHP错误Warning: Cannot modify header information - headers already sent by解决方法,需要的朋友可以参考下 今天在 ...

随机推荐

  1. sublime自动保存设置

    首选项——用户设置 (Preferences:Settings - User) 行末添加"save_on_focus_lost": true 注意用逗号分隔 保存即可 save_o ...

  2. android开源框架讲解 一 butterknif

    2019年3月16日 12:49:38 一 直接进入主题 如何配置ButterKnif 我用的是AS3.1.2 应该跟版本关系不大 1.1 下载安装Android ButterKnif Zelezny ...

  3. SpringMVC概述

    1. SpringMVC是什么 SpringMVC 是 Spring 框架内置的 MVC 的实现.SpringMVC 就是一个 Spring 内置的 MVC 子框架 Spring 子框架:意味着 Sp ...

  4. Git使用八:创建和切换分支

    git的分支 与svn对比 克隆一份全新的目录以同样拥有 5 个分支来说,SVN 是同时复制 5 个版本的文件,也就是说重复 5 次同样的动作.而 Git 只是获取文件的每个版本的元素,然后只载入主要 ...

  5. python数据类型小测试

    # 1. 有两个列表,其中一个列表a,每一项映射到另一个列表b每一项,先对a排序,要求b的中映射关系位置保持不变,给b也按照排序, (b的8对应a的[1,2], 7对应[3,4] ... ) a = ...

  6. 关于Idea模块化部署web项目,Web Resource Directories作用

    问题由来:接到某个所谓“将web工程中部分代码抽出打包,但待打包部分代码还需要在现场部署时能做微调”的需求. 解决方法:将待打包部分代码作为一个module,让工程依赖该模块,满足抽离打包与现场可调试 ...

  7. Code First

    Add-Migration ****** Update-Database –Verbose

  8. python全栈开发day112-CBV、flask_session、WTForms

    1.Flask 中的 CBV class Index(views.MethodView): # methods = ["POST"] # decorators = [war,nei ...

  9. TopCoder SRM500 Div1 250 其他

    原文链接https://www.cnblogs.com/zhouzhendong/p/SRM500-250.html SRM500 Div1 250 题意 (看题用了半个小时--) 有 n 个人(编号 ...

  10. Mqtt使用教程,简介

    1,简介 MQTT协议(Message Queuing Telemetry Transport),翻译过来就是遥信消息队列传输,是IBM公司于1999年提出的,现在最新版本是3.1.1.MQTT是一个 ...