xref: /PHP-8.0/Zend/zend_interfaces.stub.php (revision 27eb8160)
1<?php
2
3/** @generate-function-entries */
4
5interface Traversable {}
6
7interface IteratorAggregate extends Traversable
8{
9    /** @return Traversable */
10    public function getIterator();
11}
12
13interface Iterator extends Traversable
14{
15    /** @return mixed */
16    public function current();
17
18    /** @return void */
19    public function next();
20
21    /** @return mixed */
22    public function key();
23
24    /** @return bool */
25    public function valid();
26
27    /** @return void */
28    public function rewind();
29}
30
31interface ArrayAccess
32{
33    /** @return bool */
34    public function offsetExists(mixed $offset);
35
36    /**
37     * Actually this should be return by ref but atm cannot be.
38     * @return mixed
39     */
40    public function offsetGet(mixed $offset);
41
42    /** @return void */
43    public function offsetSet(mixed $offset, mixed $value);
44
45    /** @return void */
46    public function offsetUnset(mixed $offset);
47}
48
49interface Serializable
50{
51    /** @return string|null */
52    public function serialize();
53
54    /** @return void */
55    public function unserialize(string $data);
56}
57
58interface Countable
59{
60    /** @return int */
61    public function count();
62}
63
64interface Stringable
65{
66    public function __toString(): string;
67}
68
69final class InternalIterator implements Iterator
70{
71    private function __construct();
72
73    /** @return mixed */
74    public function current();
75
76    /** @return mixed */
77    public function key();
78
79    public function next(): void;
80
81    public function valid(): bool;
82
83    public function rewind(): void;
84}
85