【发布时间】:2017-09-26 20:22:43
【问题描述】:
不能在写上下文中使用函数返回值。
所有搜索结果响应都说它与空函数有关,但我没有使用它?
foreach ($permission as explode(',', $permissionString)) { // line 44
if ($this->hasPermission($permission))
$count++;
}
【问题讨论】:
-
您在 foreach 语句中的变量顺序错误。应该是:
foreach (explode(',', $permissionString) as $permission)。 As stated in the documentation:foreach (array_expression as $value).
标签: php