Search code examples
phpmagentocurrencymagento-1.8

Magento Generates System.log as Only variables should be passed by reference


In My Magento Project => 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


Solution

  • The problem is, that end requires a reference, because it modifies the internal representation of the array (i.e. it makes the current element pointer point to the last element).

    Set into a variable the result of the "$this->getCurrencies()" function, and pass this variable to the end() function