简体   繁体   English

wamp-count():参数必须是实现Countable的数组或对象

[英]wamp- count(): Parameter must be an array or an object that implements Countable

i am working on symfony and got this message 我正在使用symfony并收到此消息

Warning: count(): Parameter must be an array or an object that implements Countable 警告:count():参数必须是实现Countable的数组或对象

This message is showing only for php 7.2.14, not for php 7.1.26. 此消息仅针对php 7.2.14显示,而不针对php 7.1.26显示。

I would like a solution that is applied on the server like this one for phpmyAdmin . 我想要像在phpmyAdmin这样的服务器上应用的解决方案。

I know there are solutions involving changing the code like this one . 我知道有涉及改变这样的代码解决方案的一个

But i want a solution that is for all pages, so in the server side. 但是我想要一个适用于所有页面的解决方案,所以在服务器端。

Thanks in advance ! 提前致谢 !

PHP 7.2 now emits a warning if the count() argument is not countable. 如果count()参数不可计数,PHP 7.2现在会发出警告。 From the PHP doc : 从PHP文档:

Version 7.2.0 : count() will now yield a warning on invalid countable types passed to the array_or_countable parameter. 版本7.2.0:count()现在将对传递给array_or_countable参数的无效可计数类型产生警告。

If the issue is coming from Symfony you should update to at least Symfony version 3.4 (see this issue ). 如果问题来自Symfony,则应至少更新到Symfony 3.4版(请参阅此问题 )。

If the issue is coming from your code, you should edit your code to only count() arrays or classes implementing the Countable interface 如果问题出在您的代码中,则应将代码编辑为仅使用count()数组或实现Countable接口的类

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 count():参数必须是在其中实现Countable的数组或对象 - count(): Parameter must be an array or an object that implements Countable in 警告:count():参数必须是一个数组或一个实现 Countable 的对象 / if( count($query) ) { - Warning: count(): Parameter must be an array or an object that implements Countable / if( count($query) ) { count():参数必须是在项目中实现Countable错误的数组或对象 - count(): Parameter must be an array or an object that implements Countable error in project count():参数必须是在laravel上实现Countable的数组或对象 - count(): Parameter must be an array or an object that implements Countable on laravel PHP count():参数必须是一个数组或一个实现了Countable的对象 - PHP count(): Parameter must be an array or an object that implements Countable 继续获取count():参数必须是实现Countable的数组或对象 - Keep getting count(): Parameter must be an array or an object that implements Countable count():参数必须是数组或者实现了Countable的对象(laravel报错) - count(): Parameter must be an array or an object that implements Countable (laravel getting error) PHP:count():参数必须是数组或者实现了Countable的对象 - PHP: count(): Parameter must be an array or an object that implements Countable Error = Warning: count(): Parameter must be an array or an object that implement Countable in - Error = Warning: count(): Parameter must be an array or an object that implements Countable in 消息:count():参数必须是一个数组或实现 Countable 的 object - Message: count(): Parameter must be an array or an object that implements Countable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM