不推荐使用 each() 函数。此消息将在进一步调用 PHP 7.2 时被抑制
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51278484/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The each() function is deprecated. This message will be suppressed on further calls PHP 7.2
提问by BBT
I have the below each()
line in a PHP file on a server where I recently upgraded the PHP version from 5 to 7.
我each()
最近将 PHP 版本从 5 升级到 7 的服务器上的 PHP 文件中有以下行。
while(list($file, $info) = each($this->images))
The error below is thrown by the web server after the restart.
重新启动后,Web 服务器抛出以下错误。
The
each()
function is deprecated. This message will be suppressed on further calls
该
each()
功能已弃用。此消息将在进一步调用时被抑制
What will be the correct way of re-writing the above line of code in PHP 7.2?
在 PHP 7.2 中重写上述代码行的正确方法是什么?
Thank you.
谢谢你。