zendframework/zf2 — pull request #2397 by AlloVince (2012-09-21 08:43:48+00:00)
Title: Memcached option merge issuse

When use Zf2 cache by using memcached as adapter, I tried to change memcached lib option by below code:

$options = array(
'servers' => array(
array('127.0.0.1', 11211),
),
'namespace' => null,
'lib_options' => array(
'COMPRESSION' => false
),
);
$cache = new \Zend\Cache\Storage\Adapter\Memcached($options);

The lib_option will be convert to Memcached::OPT_COMPRESSION and merge into final array in Zend\Cache\Storage\Adapter\MemcachedOptions

Because Memcached::OPT_COMPRESSION is actually a number -1001, so after array_merge, the option array will be not destroyed such as:

array (
[-1001] => bool(false)
)

To

array (
[0] => bool(false)
)

So here need to fix to keep array key.