xref: /PHP-8.4/ext/simplexml/simplexml.stub.php (revision 4bd63568)
1<?php
2
3/** @generate-class-entries */
4
5function simplexml_load_file(string $filename, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
6
7function simplexml_load_string(string $data, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
8
9function simplexml_import_dom(object $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement {}
10
11/** @not-serializable */
12class SimpleXMLElement implements Stringable, Countable, RecursiveIterator
13{
14    /** @tentative-return-type */
15    public function xpath(string $expression): array|null|false {}
16
17    /** @tentative-return-type */
18    public function registerXPathNamespace(string $prefix, string $namespace): bool {}
19
20    /** @tentative-return-type */
21    public function asXML(?string $filename = null): string|bool {}
22
23    /**
24     * @tentative-return-type
25     * @alias SimpleXMLElement::asXML
26     */
27    public function saveXML(?string $filename = null): string|bool {}
28
29    /** @tentative-return-type */
30    public function getNamespaces(bool $recursive = false): array {}
31
32    /** @tentative-return-type */
33    public function getDocNamespaces(bool $recursive = false, bool $fromRoot = true): array|false {}
34
35    /** @tentative-return-type */
36    public function children(?string $namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElement {}
37
38    /** @tentative-return-type */
39    public function attributes(?string $namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElement {}
40
41    public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = "", bool $isPrefix = false) {}
42
43    /** @tentative-return-type */
44    public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement {}
45
46    /** @tentative-return-type */
47    public function addAttribute(string $qualifiedName, string $value, ?string $namespace = null): void {}
48
49    /** @tentative-return-type */
50    public function getName(): string {}
51
52    public function __toString(): string {}
53
54    /** @tentative-return-type */
55    public function count(): int {}
56
57    /** @tentative-return-type */
58    public function rewind(): void {}
59
60    /** @tentative-return-type */
61    public function valid(): bool {}
62
63    /** @tentative-return-type */
64    public function current(): SimpleXMLElement {}
65
66    /** @tentative-return-type */
67    public function key(): string {}
68
69    /** @tentative-return-type */
70    public function next(): void {}
71
72    /** @tentative-return-type */
73    public function hasChildren(): bool {}
74
75    /** @tentative-return-type */
76    public function getChildren(): ?SimpleXMLElement {}
77}
78
79class SimpleXMLIterator extends SimpleXMLElement
80{
81}
82