xref: /PHP-8.2/ext/dom/php_dom.stub.php (revision 41af9335)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var int
7 * @cvalue XML_ELEMENT_NODE
8 */
9const XML_ELEMENT_NODE = UNKNOWN;
10/**
11 * @var int
12 * @cvalue XML_ATTRIBUTE_NODE
13 */
14const XML_ATTRIBUTE_NODE = UNKNOWN;
15/**
16 * @var int
17 * @cvalue XML_TEXT_NODE
18 */
19const XML_TEXT_NODE = UNKNOWN;
20/**
21 * @var int
22 * @cvalue XML_CDATA_SECTION_NODE
23 */
24const XML_CDATA_SECTION_NODE = UNKNOWN;
25/**
26 * @var int
27 * @cvalue XML_ENTITY_REF_NODE
28 */
29const XML_ENTITY_REF_NODE = UNKNOWN;
30/**
31 * @var int
32 * @cvalue XML_ENTITY_NODE
33 */
34const XML_ENTITY_NODE = UNKNOWN;
35/**
36 * @var int
37 * @cvalue XML_PI_NODE
38 */
39const XML_PI_NODE = UNKNOWN;
40/**
41 * @var int
42 * @cvalue XML_COMMENT_NODE
43 */
44const XML_COMMENT_NODE = UNKNOWN;
45/**
46 * @var int
47 * @cvalue XML_DOCUMENT_NODE
48 */
49const XML_DOCUMENT_NODE = UNKNOWN;
50/**
51 * @var int
52 * @cvalue XML_DOCUMENT_TYPE_NODE
53 */
54const XML_DOCUMENT_TYPE_NODE = UNKNOWN;
55/**
56 * @var int
57 * @cvalue XML_DOCUMENT_FRAG_NODE
58 */
59const XML_DOCUMENT_FRAG_NODE = UNKNOWN;
60/**
61 * @var int
62 * @cvalue XML_NOTATION_NODE
63 */
64const XML_NOTATION_NODE = UNKNOWN;
65/**
66 * @var int
67 * @cvalue XML_HTML_DOCUMENT_NODE
68 */
69const XML_HTML_DOCUMENT_NODE = UNKNOWN;
70/**
71 * @var int
72 * @cvalue XML_DTD_NODE
73 */
74const XML_DTD_NODE = UNKNOWN;
75/**
76 * @var int
77 * @cvalue XML_ELEMENT_DECL
78 */
79const XML_ELEMENT_DECL_NODE = UNKNOWN;
80/**
81 * @var int
82 * @cvalue XML_ATTRIBUTE_DECL
83 */
84const XML_ATTRIBUTE_DECL_NODE = UNKNOWN;
85/**
86 * @var int
87 * @cvalue XML_ENTITY_DECL
88 */
89const XML_ENTITY_DECL_NODE = UNKNOWN;
90/**
91 * @var int
92 * @cvalue XML_NAMESPACE_DECL
93 */
94const XML_NAMESPACE_DECL_NODE = UNKNOWN;
95#ifdef XML_GLOBAL_NAMESPACE
96/**
97 * @var int
98 * @cvalue XML_GLOBAL_NAMESPACE
99 */
100const XML_GLOBAL_NAMESPACE = UNKNOWN;
101#endif
102
103/**
104 * @var int
105 * @cvalue XML_LOCAL_NAMESPACE
106 */
107const XML_LOCAL_NAMESPACE = UNKNOWN;
108/**
109 * @var int
110 * @cvalue XML_ATTRIBUTE_CDATA
111 */
112const XML_ATTRIBUTE_CDATA = UNKNOWN;
113/**
114 * @var int
115 * @cvalue XML_ATTRIBUTE_ID
116 */
117const XML_ATTRIBUTE_ID = UNKNOWN;
118/**
119 * @var int
120 * @cvalue XML_ATTRIBUTE_IDREF
121 */
122const XML_ATTRIBUTE_IDREF = UNKNOWN;
123/**
124 * @var int
125 * @cvalue XML_ATTRIBUTE_IDREFS
126 */
127const XML_ATTRIBUTE_IDREFS = UNKNOWN;
128/**
129 * @var int
130 * @cvalue XML_ATTRIBUTE_ENTITIES
131 */
132const XML_ATTRIBUTE_ENTITY = UNKNOWN;
133/**
134 * @var int
135 * @cvalue XML_ATTRIBUTE_NMTOKEN
136 */
137const XML_ATTRIBUTE_NMTOKEN = UNKNOWN;
138/**
139 * @var int
140 * @cvalue XML_ATTRIBUTE_NMTOKENS
141 */
142const XML_ATTRIBUTE_NMTOKENS = UNKNOWN;
143/**
144 * @var int
145 * @cvalue XML_ATTRIBUTE_ENUMERATION
146 */
147const XML_ATTRIBUTE_ENUMERATION = UNKNOWN;
148/**
149 * @var int
150 * @cvalue XML_ATTRIBUTE_NOTATION
151 */
152const XML_ATTRIBUTE_NOTATION = UNKNOWN;
153
154/**
155 * @var int
156 * @cvalue PHP_ERR
157 */
158const DOM_PHP_ERR = UNKNOWN;
159/**
160 * @var int
161 * @cvalue INDEX_SIZE_ERR
162 */
163const DOM_INDEX_SIZE_ERR = UNKNOWN;
164/**
165 * @var int
166 * @cvalue DOMSTRING_SIZE_ERR
167 */
168const DOMSTRING_SIZE_ERR = UNKNOWN;
169/**
170 * @var int
171 * @cvalue HIERARCHY_REQUEST_ERR
172 */
173const DOM_HIERARCHY_REQUEST_ERR = UNKNOWN;
174/**
175 * @var int
176 * @cvalue WRONG_DOCUMENT_ERR
177 */
178const DOM_WRONG_DOCUMENT_ERR = UNKNOWN;
179/**
180 * @var int
181 * @cvalue INVALID_CHARACTER_ERR
182 */
183const DOM_INVALID_CHARACTER_ERR = UNKNOWN;
184/**
185 * @var int
186 * @cvalue NO_DATA_ALLOWED_ERR
187 */
188const DOM_NO_DATA_ALLOWED_ERR = UNKNOWN;
189/**
190 * @var int
191 * @cvalue NO_MODIFICATION_ALLOWED_ERR
192 */
193const DOM_NO_MODIFICATION_ALLOWED_ERR = UNKNOWN;
194/**
195 * @var int
196 * @cvalue NOT_FOUND_ERR
197 */
198const DOM_NOT_FOUND_ERR = UNKNOWN;
199/**
200 * @var int
201 * @cvalue NOT_SUPPORTED_ERR
202 */
203const DOM_NOT_SUPPORTED_ERR = UNKNOWN;
204/**
205 * @var int
206 * @cvalue INUSE_ATTRIBUTE_ERR
207 */
208const DOM_INUSE_ATTRIBUTE_ERR = UNKNOWN;
209/**
210 * @var int
211 * @cvalue INVALID_STATE_ERR
212 */
213const DOM_INVALID_STATE_ERR = UNKNOWN;
214/**
215 * @var int
216 * @cvalue SYNTAX_ERR
217 */
218const DOM_SYNTAX_ERR = UNKNOWN;
219/**
220 * @var int
221 * @cvalue INVALID_MODIFICATION_ERR
222 */
223const DOM_INVALID_MODIFICATION_ERR = UNKNOWN;
224/**
225 * @var int
226 * @cvalue NAMESPACE_ERR
227 */
228const DOM_NAMESPACE_ERR = UNKNOWN;
229/**
230 * @var int
231 * @cvalue INVALID_ACCESS_ERR
232 */
233const DOM_INVALID_ACCESS_ERR = UNKNOWN;
234/**
235 * @var int
236 * @cvalue VALIDATION_ERR
237 */
238const DOM_VALIDATION_ERR = UNKNOWN;
239
240class DOMDocumentType extends DOMNode
241{
242    /** @readonly */
243    public string $name;
244
245    /** @readonly */
246    public DOMNamedNodeMap $entities;
247
248    /** @readonly */
249    public DOMNamedNodeMap $notations;
250
251    /** @readonly */
252    public string $publicId;
253
254    /** @readonly */
255    public string $systemId;
256
257    /** @readonly */
258    public ?string $internalSubset;
259}
260
261class DOMCdataSection extends DOMText
262{
263    public function __construct(string $data) {}
264}
265
266class DOMComment extends DOMCharacterData
267{
268    public function __construct(string $data = "") {}
269}
270
271interface DOMParentNode
272{
273    /** @param DOMNode|string $nodes */
274    public function append(...$nodes): void;
275
276    /** @param DOMNode|string $nodes */
277    public function prepend(...$nodes): void;
278}
279
280interface DOMChildNode
281{
282    public function remove(): void;
283
284    /** @param DOMNode|string $nodes */
285    public function before(... $nodes): void;
286
287    /** @param DOMNode|string $nodes */
288    public function after(...$nodes): void;
289
290    /** @param DOMNode|string $nodes */
291    public function replaceWith(...$nodes): void;
292}
293
294class DOMNode
295{
296    /** @readonly */
297    public string $nodeName;
298
299    public ?string $nodeValue;
300
301    /** @readonly */
302    public int $nodeType;
303
304    /** @readonly */
305    public ?DOMNode $parentNode;
306
307    /** @readonly */
308    public DOMNodeList $childNodes;
309
310    /** @readonly */
311    public ?DOMNode $firstChild;
312
313    /** @readonly */
314    public ?DOMNode $lastChild;
315
316    /** @readonly */
317    public ?DOMNode $previousSibling;
318
319    /** @readonly */
320    public ?DOMNode $nextSibling;
321
322    /** @readonly */
323    public ?DOMNamedNodeMap $attributes;
324
325    /** @readonly */
326    public ?DOMDocument $ownerDocument;
327
328    /** @readonly */
329    public ?string $namespaceURI;
330
331    public string $prefix;
332
333    /** @readonly */
334    public ?string $localName;
335
336    /** @readonly */
337    public ?string $baseURI;
338
339    public string $textContent;
340
341    public function __sleep(): array {}
342
343    public function __wakeup(): void {}
344
345    /** @return DOMNode|false */
346    public function appendChild(DOMNode $node) {}
347
348    /** @tentative-return-type */
349    public function C14N(bool $exclusive = false, bool $withComments = false, ?array $xpath = null, ?array $nsPrefixes = null): string|false {}
350
351    /** @tentative-return-type */
352    public function C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, ?array $xpath = null, ?array $nsPrefixes = null): int|false {}
353
354    /** @return DOMNode|false */
355    public function cloneNode(bool $deep = false) {}
356
357    /** @tentative-return-type */
358    public function getLineNo(): int {}
359
360    /** @tentative-return-type */
361    public function getNodePath(): ?string {}
362
363    /** @tentative-return-type */
364    public function hasAttributes(): bool {}
365
366    /** @tentative-return-type */
367    public function hasChildNodes(): bool {}
368
369    /** @return DOMNode|false */
370    public function insertBefore(DOMNode $node, ?DOMNode $child = null) {}
371
372    /** @tentative-return-type */
373    public function isDefaultNamespace(string $namespace): bool {}
374
375    /** @tentative-return-type */
376    public function isSameNode(DOMNode $otherNode): bool {}
377
378    /** @tentative-return-type */
379    public function isSupported(string $feature, string $version): bool {}
380
381    /** @tentative-return-type */
382    public function lookupNamespaceURI(?string $prefix): ?string {}
383
384    /** @tentative-return-type */
385    public function lookupPrefix(string $namespace): ?string {}
386
387    /** @tentative-return-type */
388    public function normalize(): void {}
389
390    /** @return DOMNode|false */
391    public function removeChild(DOMNode $child) {}
392
393    /** @return DOMNode|false */
394    public function replaceChild(DOMNode $node, DOMNode $child) {}
395}
396
397class DOMNameSpaceNode
398{
399    /** @readonly */
400    public string $nodeName;
401
402    /** @readonly */
403    public ?string $nodeValue;
404
405    /** @readonly */
406    public int $nodeType;
407
408    /** @readonly */
409    public string $prefix;
410
411    /** @readonly */
412    public ?string $localName;
413
414    /** @readonly */
415    public ?string $namespaceURI;
416
417    /** @readonly */
418    public ?DOMDocument $ownerDocument;
419
420    /** @readonly */
421    public ?DOMNode $parentNode;
422
423    /** @implementation-alias DOMNode::__sleep */
424    public function __sleep(): array {}
425
426    /** @implementation-alias DOMNode::__wakeup */
427    public function __wakeup(): void {}
428}
429
430class DOMImplementation
431{
432    /** @tentative-return-type */
433    public function getFeature(string $feature, string $version): never {}
434
435    /** @tentative-return-type */
436    public function hasFeature(string $feature, string $version): bool {}
437
438    /** @return DOMDocumentType|false */
439    public function createDocumentType(string $qualifiedName, string $publicId = "", string $systemId = "") {}
440
441    /** @return DOMDocument|false */
442    public function createDocument(?string $namespace = null, string $qualifiedName = "", ?DOMDocumentType $doctype = null) {}
443}
444
445class DOMDocumentFragment extends DOMNode implements DOMParentNode
446{
447    /** @readonly */
448    public ?DOMElement $firstElementChild;
449
450    /** @readonly */
451    public ?DOMElement $lastElementChild;
452
453    /** @readonly */
454    public int $childElementCount;
455
456    public function __construct() {}
457
458    /** @tentative-return-type */
459    public function appendXML(string $data): bool {}
460
461    /** @param DOMNode|string $nodes */
462    public function append(...$nodes): void {}
463
464    /** @param DOMNode|string $nodes */
465    public function prepend(...$nodes): void {}
466}
467
468class DOMNodeList implements IteratorAggregate, Countable
469{
470    /** @readonly */
471    public int $length;
472
473    /** @tentative-return-type */
474    public function count(): int {}
475
476    public function getIterator(): Iterator {}
477
478    /** @return DOMElement|DOMNode|DOMNameSpaceNode|null */
479    public function item(int $index) {}
480}
481
482class DOMCharacterData extends DOMNode implements DOMChildNode
483{
484    public string $data;
485
486    /** @readonly */
487    public int $length;
488
489    /** @readonly */
490    public ?DOMElement $previousElementSibling;
491
492    /** @readonly */
493    public ?DOMElement $nextElementSibling;
494
495    /** @tentative-return-type */
496    public function appendData(string $data): bool {}
497
498    /** @return string|false */
499    public function substringData(int $offset, int $count) {}
500
501    /** @tentative-return-type */
502    public function insertData(int $offset, string $data): bool {}
503
504    /** @tentative-return-type */
505    public function deleteData(int $offset, int $count): bool {}
506
507    /** @tentative-return-type */
508    public function replaceData(int $offset, int $count, string $data): bool {}
509
510    /** @param DOMNode|string $nodes */
511    public function replaceWith(...$nodes): void {}
512
513    public function remove(): void {}
514
515    /** @param DOMNode|string $nodes */
516    public function before(... $nodes): void {}
517
518    /** @param DOMNode|string $nodes */
519    public function after(...$nodes): void {}
520}
521
522class DOMAttr extends DOMNode
523{
524    /** @readonly */
525    public string $name;
526
527    /** @readonly */
528    public bool $specified = true;
529
530    public string $value;
531
532    /** @readonly */
533    public ?DOMElement $ownerElement;
534
535    /** @readonly */
536    public mixed $schemaTypeInfo = null;
537
538    public function __construct(string $name, string $value = "") {}
539
540    /** @tentative-return-type */
541    public function isId(): bool {}
542}
543
544class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode
545{
546    /** @readonly */
547    public string $tagName;
548
549    /** @readonly */
550    public mixed $schemaTypeInfo = null;
551
552    /** @readonly */
553    public ?DOMElement $firstElementChild;
554
555    /** @readonly */
556    public ?DOMElement $lastElementChild;
557
558    /** @readonly */
559    public int $childElementCount;
560
561    /** @readonly */
562    public ?DOMElement $previousElementSibling;
563
564    /** @readonly */
565    public ?DOMElement $nextElementSibling;
566
567    public function __construct(string $qualifiedName, ?string $value = null, string $namespace = "") {}
568
569    /** @tentative-return-type */
570    public function getAttribute(string $qualifiedName): string {}
571
572    /** @tentative-return-type */
573    public function getAttributeNS(?string $namespace, string $localName): string {}
574
575    /** @return DOMAttr|DOMNameSpaceNode|false */
576    public function getAttributeNode(string $qualifiedName) {}
577
578    /** @return DOMAttr|DOMNameSpaceNode|null */
579    public function getAttributeNodeNS(?string $namespace, string $localName) {}
580
581    /** @tentative-return-type */
582    public function getElementsByTagName(string $qualifiedName): DOMNodeList {}
583
584    /** @tentative-return-type */
585    public function getElementsByTagNameNS(?string $namespace, string $localName): DOMNodeList {}
586
587    /** @tentative-return-type */
588    public function hasAttribute(string $qualifiedName): bool {}
589
590    /** @tentative-return-type */
591    public function hasAttributeNS(?string $namespace, string $localName): bool {}
592
593    /** @tentative-return-type */
594    public function removeAttribute(string $qualifiedName): bool {}
595
596    /** @tentative-return-type */
597    public function removeAttributeNS(?string $namespace, string $localName): void {}
598
599    /** @return DOMAttr|false */
600    public function removeAttributeNode(DOMAttr $attr) {}
601
602    /** @return DOMAttr|bool */
603    public function setAttribute(string $qualifiedName, string $value) {} // TODO return type shouldn't depend on the call scope
604
605    /** @tentative-return-type */
606    public function setAttributeNS(?string $namespace, string $qualifiedName, string $value): void {}
607
608    /** @return DOMAttr|null|false */
609    public function setAttributeNode(DOMAttr $attr) {}
610
611    /** @return DOMAttr|null|false */
612    public function setAttributeNodeNS(DOMAttr $attr) {}
613
614    /** @tentative-return-type */
615    public function setIdAttribute(string $qualifiedName, bool $isId): void {}
616
617    /** @tentative-return-type */
618    public function setIdAttributeNS(string $namespace, string $qualifiedName, bool $isId): void {}
619
620    /** @tentative-return-type */
621    public function setIdAttributeNode(DOMAttr $attr, bool $isId): void {}
622
623    public function remove(): void {}
624
625    /** @param DOMNode|string $nodes */
626    public function before(... $nodes): void {}
627
628    /** @param DOMNode|string $nodes */
629    public function after(...$nodes): void {}
630
631    /** @param DOMNode|string $nodes */
632    public function replaceWith(...$nodes): void {}
633
634    /** @param DOMNode|string $nodes */
635    public function append(...$nodes): void {}
636
637    /** @param DOMNode|string $nodes */
638    public function prepend(...$nodes): void {}
639}
640
641class DOMDocument extends DOMNode implements DOMParentNode
642{
643    /** @readonly */
644    public ?DOMDocumentType $doctype;
645
646    /** @readonly */
647    public DOMImplementation $implementation;
648
649    /** @readonly */
650    public ?DOMElement $documentElement;
651
652    /**
653     * @readonly
654     * @deprecated
655     */
656    public ?string $actualEncoding;
657
658    public ?string $encoding;
659
660    /** @readonly */
661    public ?string $xmlEncoding;
662
663    public bool $standalone;
664
665    public bool $xmlStandalone;
666
667    public ?string $version;
668
669    public ?string $xmlVersion;
670
671    public bool $strictErrorChecking;
672
673    public ?string $documentURI;
674
675    /**
676     * @readonly
677     * @deprecated
678     */
679    public mixed $config;
680
681    public bool $formatOutput;
682
683    public bool $validateOnParse;
684
685    public bool $resolveExternals;
686
687    public bool $preserveWhiteSpace;
688
689    public bool $recover;
690
691    public bool $substituteEntities;
692
693    /** @readonly */
694    public ?DOMElement $firstElementChild;
695
696    /** @readonly */
697    public ?DOMElement $lastElementChild;
698
699    /** @readonly */
700    public int $childElementCount;
701
702    public function __construct(string $version = "1.0", string $encoding = "") {}
703
704    /** @return DOMAttr|false */
705    public function createAttribute(string $localName) {}
706
707    /** @return DOMAttr|false */
708    public function createAttributeNS(?string $namespace, string $qualifiedName) {}
709
710    /** @return DOMCdataSection|false */
711    public function createCDATASection(string $data) {}
712
713    /** @tentative-return-type */
714    public function createComment(string $data): DOMComment {}
715
716    /** @tentative-return-type */
717    public function createDocumentFragment(): DOMDocumentFragment {}
718
719    /** @return DOMElement|false */
720    public function createElement(string $localName, string $value = "")  {}
721
722    /** @return DOMElement|false */
723    public function createElementNS(?string $namespace, string $qualifiedName, string $value = "") {}
724
725    /** @return DOMEntityReference|false */
726    public function createEntityReference(string $name) {}
727
728    /** @return DOMProcessingInstruction|false */
729    public function createProcessingInstruction(string $target, string $data = "") {}
730
731    /** @tentative-return-type */
732    public function createTextNode(string $data): DOMText {}
733
734    /** @tentative-return-type */
735    public function getElementById(string $elementId): ?DOMElement {}
736
737    /** @tentative-return-type */
738    public function getElementsByTagName(string $qualifiedName): DOMNodeList {}
739
740    /** @tentative-return-type */
741    public function getElementsByTagNameNS(?string $namespace, string $localName): DOMNodeList {}
742
743    /** @return DOMNode|false */
744    public function importNode(DOMNode $node, bool $deep = false) {}
745
746    /** @return bool */
747    public function load(string $filename, int $options = 0) {}
748
749    /** @return bool */
750    public function loadXML(string $source, int $options = 0) {}
751
752    /** @tentative-return-type */
753    public function normalizeDocument(): void {}
754
755    /** @tentative-return-type */
756    public function registerNodeClass(string $baseClass, ?string $extendedClass): bool {}
757
758    /** @tentative-return-type */
759    public function save(string $filename, int $options = 0): int|false {}
760
761#ifdef LIBXML_HTML_ENABLED
762    /** @return bool */
763    public function loadHTML(string $source, int $options = 0) {}
764
765    /** @return bool */
766    public function loadHTMLFile(string $filename, int $options = 0) {}
767
768    /** @tentative-return-type */
769    public function saveHTML(?DOMNode $node = null): string|false {}
770
771    /** @tentative-return-type */
772    public function saveHTMLFile(string $filename): int|false {}
773#endif
774
775    /** @tentative-return-type */
776    public function saveXML(?DOMNode $node = null, int $options = 0): string|false {}
777
778#ifdef LIBXML_SCHEMAS_ENABLED
779    /** @tentative-return-type */
780    public function schemaValidate(string $filename, int $flags = 0): bool {}
781
782    /** @tentative-return-type */
783    public function schemaValidateSource(string $source, int $flags = 0): bool {}
784
785    /** @tentative-return-type */
786    public function relaxNGValidate(string $filename): bool {}
787
788    /** @tentative-return-type */
789    public function relaxNGValidateSource(string $source): bool {}
790#endif
791
792    /** @tentative-return-type */
793    public function validate(): bool {}
794
795    /** @tentative-return-type */
796    public function xinclude(int $options = 0): int|false {}
797
798    /** @return DOMNode|false */
799    public function adoptNode(DOMNode $node) {}
800
801    /** @param DOMNode|string $nodes */
802    public function append(...$nodes): void {}
803
804    /** @param DOMNode|string $nodes */
805    public function prepend(...$nodes): void {}
806}
807
808final class DOMException extends Exception
809{
810    /**
811     * Intentionally left untyped for BC reasons
812     * @var int
813     */
814    public $code = 0; // TODO add proper type (i.e. int|string)
815}
816
817class DOMText extends DOMCharacterData
818{
819    /** @readonly */
820    public string $wholeText;
821
822    public function __construct(string $data = "") {}
823
824    /** @tentative-return-type */
825    public function isWhitespaceInElementContent(): bool {}
826
827    /**
828     * @tentative-return-type
829     * @alias DOMText::isWhitespaceInElementContent
830     */
831    public function isElementContentWhitespace(): bool {}
832
833    /** @return DOMText|false */
834    public function splitText(int $offset) {}
835}
836
837class DOMNamedNodeMap implements IteratorAggregate, Countable
838{
839    /** @readonly */
840    public int $length;
841
842    /** @tentative-return-type */
843    public function getNamedItem(string $qualifiedName): ?DOMNode {} // TODO DOM spec returns DOMAttr
844
845    /** @tentative-return-type */
846    public function getNamedItemNS(?string $namespace, string $localName): ?DOMNode {} // TODO DOM spec returns DOMAttr
847
848    /** @tentative-return-type */
849    public function item(int $index): ?DOMNode {} // TODO DOM spec returns DOMAttr
850
851    /** @tentative-return-type */
852    public function count(): int {}
853
854    public function getIterator(): Iterator {}
855}
856
857class DOMEntity extends DOMNode
858{
859    /** @readonly */
860    public ?string $publicId;
861
862    /** @readonly */
863    public ?string $systemId;
864
865    /** @readonly */
866    public ?string $notationName;
867
868    /**
869     * @readonly
870     * @deprecated
871     */
872    public ?string $actualEncoding = null;
873
874    /**
875     * @readonly
876     * @deprecated
877     */
878    public ?string $encoding = null;
879
880    /**
881     * @readonly
882     * @deprecated
883     */
884    public ?string $version = null;
885}
886
887class DOMEntityReference extends DOMNode
888{
889    public function __construct(string $name) {}
890}
891
892class DOMNotation extends DOMNode
893{
894    /** @readonly */
895    public string $publicId;
896
897    /** @readonly */
898    public string $systemId;
899}
900
901class DOMProcessingInstruction extends DOMNode
902{
903    /** @readonly */
904    public string $target;
905
906    public string $data;
907
908    public function __construct(string $name, string $value = "") {}
909}
910
911#ifdef LIBXML_XPATH_ENABLED
912/** @not-serializable */
913class DOMXPath
914{
915    /** @readonly */
916    public DOMDocument $document;
917
918    public bool $registerNodeNamespaces;
919
920    public function __construct(DOMDocument $document, bool $registerNodeNS = true) {}
921
922    /** @tentative-return-type */
923    public function evaluate(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed {}
924
925    /** @tentative-return-type */
926    public function query(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed {}
927
928    /** @tentative-return-type */
929    public function registerNamespace(string $prefix, string $namespace): bool {}
930
931    /** @tentative-return-type */
932    public function registerPhpFunctions(string|array|null $restrict = null): void {}
933}
934#endif
935
936function dom_import_simplexml(object $node): DOMAttr|DOMElement {}
937