xref: /PHP-8.0/ext/spl/spl_array.stub.php (revision 80e5ad5a)
1<?php
2
3/** @generate-function-entries */
4
5class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable
6{
7    public function __construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) {}
8
9    /** @return bool */
10    public function offsetExists(mixed $key) {}
11
12    /** @return mixed */
13    public function offsetGet(mixed $key) {}
14
15    /** @return void */
16    public function offsetSet(mixed $key, mixed $value) {}
17
18    /** @return void */
19    public function offsetUnset(mixed $key) {}
20
21    /** @return void */
22    public function append(mixed $value) {}
23
24    /** @return array */
25    public function getArrayCopy() {}
26
27    /** @return int */
28    public function count() {}
29
30    /** @return int */
31    public function getFlags() {}
32
33    /** @return void */
34    public function setFlags(int $flags) {}
35
36    /** @return bool */
37    public function asort(int $flags = SORT_REGULAR) {}
38
39    /** @return bool */
40    public function ksort(int $flags = SORT_REGULAR) {}
41
42    /** @return bool */
43    public function uasort(callable $callback) {}
44
45    /** @return bool */
46    public function uksort(callable $callback) {}
47
48    /** @return bool */
49    public function natsort() {}
50
51    /** @return bool */
52    public function natcasesort() {}
53
54    /** @return void */
55    public function unserialize(string $data) {}
56
57    /** @return string */
58    public function serialize() {}
59
60    /** @return array */
61    public function __serialize() {}
62
63    /** @return void */
64    public function __unserialize(array $data) {}
65
66    /** @return Iterator */
67    public function getIterator() {}
68
69    /** @return array */
70    public function exchangeArray(array|object $array) {}
71
72    /** @return void */
73    public function setIteratorClass(string $iteratorClass) {}
74
75    /** @return string */
76    public function getIteratorClass() {}
77
78    /** @return array */
79    public function __debugInfo() {}
80}
81
82class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Countable
83{
84    public function __construct(array|object $array = [], int $flags = 0) {}
85
86    /**
87     * @return bool
88     * @implementation-alias ArrayObject::offsetExists
89     */
90    public function offsetExists(mixed $key) {}
91
92    /**
93     * @return mixed
94     * @implementation-alias ArrayObject::offsetGet
95     */
96    public function offsetGet(mixed $key) {}
97
98    /**
99     * @return void
100     * @implementation-alias ArrayObject::offsetSet
101     */
102    public function offsetSet(mixed $key, mixed $value) {}
103
104    /**
105     * @return void
106     * @implementation-alias ArrayObject::offsetUnset
107     */
108    public function offsetUnset(mixed $key) {}
109
110    /**
111     * @return void
112     * @implementation-alias ArrayObject::append
113     */
114    public function append(mixed $value) {}
115
116    /**
117     * @return array
118     * @implementation-alias ArrayObject::getArrayCopy
119     */
120    public function getArrayCopy() {}
121
122    /**
123     * @return int
124     * @implementation-alias ArrayObject::count
125     */
126    public function count() {}
127
128    /**
129     * @return int
130     * @implementation-alias ArrayObject::getFlags
131     */
132    public function getFlags() {}
133
134    /**
135     * @return void
136     * @implementation-alias ArrayObject::setFlags
137     */
138    public function setFlags(int $flags) {}
139
140    /**
141     * @return bool
142     * @implementation-alias ArrayObject::asort
143     */
144    public function asort(int $flags = SORT_REGULAR) {}
145
146    /**
147     * @return bool
148     * @implementation-alias ArrayObject::ksort
149     */
150    public function ksort(int $flags = SORT_REGULAR) {}
151
152    /**
153     * @return bool
154     * @implementation-alias ArrayObject::uasort
155     */
156    public function uasort(callable $callback) {}
157
158    /**
159     * @return bool
160     * @implementation-alias ArrayObject::uksort
161     */
162    public function uksort(callable $callback) {}
163
164    /**
165     * @return bool
166     * @implementation-alias ArrayObject::natsort
167     */
168    public function natsort() {}
169
170    /**
171     * @return bool
172     * @implementation-alias ArrayObject::natcasesort
173     */
174    public function natcasesort() {}
175
176    /**
177     * @return void
178     * @implementation-alias ArrayObject::unserialize
179     */
180    public function unserialize(string $data) {}
181
182    /**
183     * @return string
184     * @implementation-alias ArrayObject::serialize
185     */
186    public function serialize() {}
187
188    /**
189     * @return array
190     * @implementation-alias ArrayObject::__serialize
191     */
192    public function __serialize() {}
193
194    /**
195     * @return void
196     * @implementation-alias ArrayObject::__unserialize
197     */
198    public function __unserialize(array $data) {}
199
200    /** @return void */
201    public function rewind() {}
202
203    /** @return mixed */
204    public function current() {}
205
206    /** @return mixed */
207    public function key() {}
208
209    /** @return void */
210    public function next() {}
211
212    /** @return bool */
213    public function valid() {}
214
215    /** @return void */
216    public function seek(int $offset) {}
217
218    /**
219     * @return array
220     * @implementation-alias ArrayObject::__debugInfo
221     */
222    public function __debugInfo() {}
223}
224
225class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
226{
227    /** @return bool */
228    public function hasChildren() {}
229
230    /** @return RecursiveArrayIterator|null */
231    public function getChildren() {}
232}
233