public function deleteMulti(array $keys)
{
// attempt to get locks for all items
$locked = $this->lock($keys);
$failed = array_diff($keys, $locked);
$keys = array_intersect($keys, $locked);
// only delete those where lock was acquired
if ($keys) {
/**
* Contrary to the docs, apc_delete also accepts an array of
* multiple keys to be deleted. Docs for apcu_delete are ok in this
* regard.
* But both are flawed in terms of return value in this case: an
* array with failed keys is returned.
*
* @see http://php.net/manual/en/function.apc-delete.php
*
* @var string[]
*/
$result = $this->apcu_delete($keys);
$failed = array_merge($failed, $result);
$this->unlock($keys);
}
$return = array();
foreach ($keys as $key) {
$return[$key] = !in_array($key, $failed);
unset($this->expires[$key]);
}
return $return;
}