source/Application/Model/Basket.php
protected function _changeBasketItemKey($sOldKey, $sNewKey, $value = null)
    {
        reset($this->_aBasketContents);
        $iOldKeyPlace = 0;
        while (key($this->_aBasketContents) != $sOldKey && next($this->_aBasketContents)) {
            ++$iOldKeyPlace;
        }
        $aNewCopy = array_merge(
            array_slice($this->_aBasketContents, 0, $iOldKeyPlace, true),
            [$sNewKey => $value],
            array_slice($this->_aBasketContents, $iOldKeyPlace + 1, count($this->_aBasketContents) - $iOldKeyPlace, true)
        );
        $this->_aBasketContents = $aNewCopy;
    }
protected function _changeBasketItemKey($sOldKey, $sNewKey, $value = null)
    {
        reset($this->_aBasketContents);
        $iOldKeyPlace = 0;
        while (key($this->_aBasketContents) != $sOldKey && next($this->_aBasketContents)) {
            ++$iOldKeyPlace;
        }
        $aNewCopy = array_merge(
            array_slice($this->_aBasketContents, 0, $iOldKeyPlace, true),
            [$sNewKey => $value],
            array_slice($this->_aBasketContents, $iOldKeyPlace + 1, count($this->_aBasketContents) - $iOldKeyPlace, true)
        );
        $this->_aBasketContents = $aNewCopy;
    }
protected function _changeBasketItemKey ( $ sOldKey , $ sNewKey , $ value = null ) { reset ( $ this -> _aBasketContents ) ; $ iOldKeyPlace = 0 ; while ( key ( $ this -> _aBasketContents ) != $ sOldKey && next ( $ this -> _aBasketContents ) ) { ++ $ iOldKeyPlace ; } $ aNewCopy = array_merge ( array_slice ( $ this -> _aBasketContents , 0 , $ iOldKeyPlace , true ) , [ $ sNewKey => $ value ] , array_slice ( $ this -> _aBasketContents , $ iOldKeyPlace + 1 , count ( $ this -> _aBasketContents ) - $ iOldKeyPlace , true ) ) ; $ this -> _aBasketContents = $ aNewCopy ; }
change old key to new one but retain key position in array

@param string $sOldKey old key
@param string $sNewKey new key to place in old one's place
@param mixed  $value   (optional)
change old key to new one but retain key position in array