System.log generates following Error

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

The Code at Line 9 is as follows :

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

I referred this URL & this, But No Success


This is more of a PHP problem than a Magento problem. As both of your links point out, end is expecting an array, not a function result. A function result is not equivalent to an array even if its return type is "array".

You need to do the following to fix this issue:

$currencies = $this->getCurrencies();
$lastCurrency = end($currencies);

Assuming, of course, that the getCurrencies() method is returning an array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.