/** * Get an item from the array by offset * * @param int $offset The offset * @return mixed The item from the array */ public function offsetGet($offset) { if (!parent::offsetExists($offset)) { $result = apc_fetch($this->_namespace . '-' . $offset); } else { $result = parent::offsetGet($offset); } return $result; }
/** * Get an item from the array by offset * * @param int $offset The offset * @return mixed The item from the array */ public function offsetGet($offset) { if (!parent::offsetExists($offset)) { if ($result = apc_fetch($this->getNamespace() . '-class_' . $offset)) { parent::offsetSet($offset, $result); } } else { $result = parent::offsetGet($offset); } return $result; }