innerNode->wholeText; } public function splitText(int $offset): Text { // PHP DOM mostly handles this correctly with the exception of not throwing an // exception when the offset is greater than the length, so let's fix that. if ($offset > $this->length) { throw new DOMException(DOMException::INDEX_SIZE_ERROR); } return $this->innerNode->ownerDocument->getWrapperNode($this->innerNode->splitText($offset)); } }