Php Magento生成System.log,因为只应通过引用传递变量

Php Magento生成System.log,因为只应通过引用传递变量,php,magento,currency,magento-1.8,Php,Magento,Currency,Magento 1.8,在My Magento项目中=>System.log生成以下错误 2014-06-28T12:34:58+00:00 ERR (3): Strict Notice: Only variables should be passed by reference in D:\INETPUB\VHOSTS\DOMAINNAME\app\design\frontend\THEME\default\template\directory\currency-top.phtml on line 9 第9行代码

在My Magento项目中=>System.log生成以下错误

2014-06-28T12:34:58+00:00 ERR (3): Strict Notice: Only variables should be passed by reference  in
 D:\INETPUB\VHOSTS\DOMAINNAME\app\design\frontend\THEME\default\template\directory\currency-top.phtml on line 9
第9行代码如下:

$last_item = end(($this->getCurrencies()));

我引用了这个&,但没有成功

问题是,这个端点需要引用,因为它修改了数组的内部表示(即,它使当前元素指针指向最后一个元素)


将“$this->getCurrencies()”函数的结果设置为一个变量,并将该变量传递给end()函数

$getCurrencies = $this->getCurrencies();

$last_item = end(($getCurrencies));

试试这个<代码>$var=$this->getCurrencies()$最后一项=结束($var)