PHP的数组与引用

  ECshop刚安装完成后,提示:Strict Standards: Only variables should be passed by reference in...

  标头Strict Standards表示php.ini配置文件里的error_reporting的值是E_STRICT,应该改成E_ALL。

  按照PHP严格的写法,array_shift()函数里应该传的是一个数组引用,这个引用只能是变量,而如果直接这样写:$tag_sel = array_shift(explode(' ', $tag));因为explode(' ', $tag)返回是是一个常量,所以应该分开写:

$t = explode(' ', $tag);
$tag_sel = array_shift($t);
原文地址:https://www.cnblogs.com/thinksasa/p/2956344.html