PHP致命错误:调用时传递引用已被删除 [英] PHP Fatal error: Call-time pass-by-reference has been removed
本文介绍了PHP致命错误:调用时传递引用已被删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的脚本很旧,最近又收到此错误:
I have an oldish script and lately I get this error:
Fatal error: Call-time pass-by-reference has been removed in /****/******/public_html/****/cp-list-summary.php on line 100
在该文件的第100行周围看起来像这样:
And it looks like this around line 100 on that file:
if ($row[images])
{
$image_set = array ();
$result = mysql_query ('SELECT fname FROM ' . $dbimgs . ' WHERE listid=\'' . $_GET['id'] . '\' ORDER BY id ASC', $link);
while ($images = mysql_fetch_array ($result))
{
array_push (&$image_set, $images[fname]);
}
}
什么原因导致该错误以及如何解决?我不是开发人员,所以请慢一点.
What causes the error and how to fix it? I'm not a developer, so please take it slow.
推荐答案
您正在尝试将指针传递给array_push
中的数组.这就是为什么会遇到致命错误的原因.只需使用:
You are trying to pass a pointer to your array in array_push
. That is why the fatal error is encountered. Simply use:
array_push( $image_set, $images[fname] );
注意:如果第一个参数不为
array_push()
,则会发出警告 数组.
Note:
array_push()
will raise a warning if the first argument is not an array.
这篇关于PHP致命错误:调用时传递引用已被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文