【发布时间】:2011-10-07 06:15:25
【问题描述】:
函数parse_users返回一个数组。
我正在另一个函数中执行以下操作:
return reset($this->parse_users($records));
但我得到了Strict Standards: Only variables should be passed by reference in...
是不是因为我在函数上做了reset()?
我必须这样做吗:
$users = $this->parse_users($records);
return reset($users);
还是别的什么?
【问题讨论】:
-
制作a testcase.
-
@Tomalak:看我对创世纪答案的评论
-
我看到了,已经回复了......它与测试用例有什么关系?
-
return $this->parse_users($records)[0]如果你愿意安装 PHP 5.4 ;)
标签: php