xref: /PHP-8.1/ext/zend_test/test.stub.php (revision 78fba9cb)
1<?php
2
3/** @generate-class-entries static */
4
5namespace {
6
7    interface _ZendTestInterface
8    {
9    }
10
11    /** @alias _ZendTestClassAlias */
12    class _ZendTestClass implements _ZendTestInterface {
13        /** @var mixed */
14        public static $_StaticProp;
15        public static int $staticIntProp = 123;
16
17        public int $intProp = 123;
18        public ?stdClass $classProp = null;
19        public stdClass|Iterator|null $classUnionProp = null;
20        public readonly int $readonlyProp;
21
22        public static function is_object(): int {}
23
24        /**
25         * @deprecated
26         * @return string
27         */
28        public function __toString() {}
29
30        public function returnsStatic(): static {}
31
32        public function returnsThrowable(): Throwable {}
33
34        static public function variadicTest(string|Iterator ...$elements) : static {}
35    }
36
37    class _ZendTestChildClass extends _ZendTestClass
38    {
39        public function returnsThrowable(): Exception {}
40    }
41
42    trait _ZendTestTrait {
43        /** @var mixed */
44        public $testProp;
45
46        public function testMethod(): bool {}
47    }
48
49    final class ZendTestAttribute {
50
51    }
52
53    final class ZendTestParameterAttribute {
54        public string $parameter;
55
56        public function __construct(string $parameter) {}
57    }
58
59    class ZendTestClassWithMethodWithParameterAttribute {
60        final public function no_override(string $parameter): int {}
61        public function override(string $parameter): int {}
62    }
63
64    class ZendTestChildClassWithMethodWithParameterAttribute extends ZendTestClassWithMethodWithParameterAttribute {
65        public function override(string $parameter): int {}
66    }
67
68    enum ZendTestUnitEnum {
69        case Foo;
70        case Bar;
71    }
72
73    enum ZendTestStringEnum: string {
74        case Foo = "Test1";
75        case Bar = "Test2";
76        case Baz = "Test2\\a";
77        case FortyTwo = "42";
78    }
79
80    function zend_test_array_return(): array {}
81
82    function zend_test_nullable_array_return(): ?array {}
83
84    function zend_test_void_return(): void {}
85
86    /** @deprecated */
87    function zend_test_deprecated(mixed $arg = null): void {}
88
89    function zend_create_unterminated_string(string $str): string {}
90
91    function zend_terminate_string(string &$str): void {}
92
93    function zend_leak_variable(mixed $variable): void {}
94
95    function zend_leak_bytes(int $bytes = 3): void {}
96
97    function zend_string_or_object(object|string $param): object|string {}
98
99    function zend_string_or_object_or_null(object|string|null $param): object|string|null {}
100
101    /** @param stdClass|string $param */
102    function zend_string_or_stdclass($param): stdClass|string {}
103
104    /** @param stdClass|string|null $param */
105    function zend_string_or_stdclass_or_null($param): stdClass|string|null {}
106
107    function zend_iterable(iterable $arg1, ?iterable $arg2 = null): void {}
108
109    function zend_weakmap_attach(object $object, mixed $value): bool {}
110    function zend_weakmap_remove(object $object): bool {}
111    function zend_weakmap_dump(): array {}
112
113    function zend_get_unit_enum(): ZendTestUnitEnum {}
114
115    function zend_test_parameter_with_attribute(string $parameter): int {}
116
117    function zend_get_current_func_name(): string {}
118
119    function zend_call_method(string $class, string $method, mixed $arg1 = UNKNOWN, mixed $arg2 = UNKNOWN): mixed {}
120
121    function zend_get_map_ptr_last(): int {}
122
123    function zend_test_crash(?string $message = null): void {}
124
125#if defined(HAVE_LIBXML) && !defined(PHP_WIN32)
126function zend_test_override_libxml_global_state(): void {}
127#endif
128
129    function zend_test_is_pcre_bundled(): bool {}
130}
131
132namespace ZendTestNS {
133
134    class Foo {
135        public function method(): void {}
136    }
137
138}
139
140namespace ZendTestNS2 {
141
142    class Foo {
143        public ZendSubNS\Foo $foo;
144
145        public function method(): void {}
146    }
147
148}
149
150namespace ZendTestNS2\ZendSubNS {
151
152    class Foo {
153        public function method(): void {}
154    }
155
156    function namespaced_func(): bool {}
157
158}
159