/** * Returns whether an element exists at a given offset. Required by the ArrayAccess interface. * * @param mixed $offset * * @return bool */ public function offsetExists($offset) { if (is_numeric($offset)) { return $this->nth($offset) !== null; } else { return parent::offsetExists($offset); } }