(PHP 8 >= 8.4.0)
Represents an entire HTML or XML document; serves as the root of the document tree.
This is the modern, spec-compliant equivalent of DOMDocument. It is the base class for Dom\XMLDocument and Dom\HTMLDocument.
The DOMImplementation object that handles this document.
The Document Type Declaration associated with this document.
Equivalent to documentURI.
The encoding of the document used for serialization. Upon parsing a document, this is set to the input encoding of that document.
Legacy alias for characterSet.
Legacy alias for characterSet.
The location of the document or null if undefined.
The Dom\Element that is the document element.
This evaluates to null for document without elements.
First child element or null.
Last child element or null.
The number of child elements.
A Dom\HTMLCollection containing all child elements of this node. Available as of PHP 8.5.0.
The first child of the html element that is either a
body tag or a frameset tag.
These need to be in the HTML namespace.
If no element matches, this evaluates to null.
The first head element that is a child of the
html element.
These need to be in the HTML namespace.
If no element matches, this evaluates to null.
The title of the document as set by the title
element for HTML or the SVG title element for SVG.
If there is no title, this evaluates to the empty string.