php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
test.stub.php
Go to the documentation of this file.
1<?php
2
8namespace {
9 require "Zend/zend_attributes.stub.php";
10
16
18 const ZEND_CONSTANT_A = "global";
19
21 {
28 public const DUMMY = 0;
29 }
30
33 public const mixed TYPED_CLASS_CONST1 = [];
34 public const int|array TYPED_CLASS_CONST2 = 42;
39 public const int|string TYPED_CLASS_CONST3 = UNKNOWN;
40
44 public const int ZEND_TEST_DEPRECATED = 42;
45
46 #[\Deprecated(message: "custom message")]
47 public const int ZEND_TEST_DEPRECATED_ATTR = 42;
48
50 public static $_StaticProp;
51 public static int $staticIntProp = 123;
52
53 public int $intProp = 123;
54 public ?stdClass $classProp = null;
55 public stdClass|Iterator|null $classUnionProp = null;
58
59 public static function is_object(): int {}
60
62 public function __toString(): string {}
63
64 public function returnsStatic(): static {}
65
67
68 static public function variadicTest(string|Iterator ...$elements) : static {}
69
70 public function takesUnionType(stdclass|Iterator $arg): void {}
71 }
72
74 {
75 public function __call(string $name, array $args): mixed {}
76 }
77
79 {
80 public function __call(string $name, array $args): mixed {}
81 }
82
84 {
85 public function returnsThrowable(): Exception {}
86 }
87
94
99 public const TEST_CONST = 1;
100
102 #[ZendTestRepeatableAttribute]
103 #[ZendTestPropertyAttribute("testProp")]
104 public $testProp;
105
106 #[ZendTestAttribute]
107 public function testMethod(): bool {}
108 }
109
112 public $testProp;
114
115 public function testMethod(): bool {}
116 }
117
118 #[Attribute(Attribute::TARGET_ALL)]
119 final class ZendTestAttribute {
120 }
121
122 #[Attribute(Attribute::TARGET_ALL)]
124 public readonly mixed $arg;
125
126 public function __construct(mixed $arg) {}
127 }
128
129 #[Attribute(Attribute::TARGET_ALL|Attribute::IS_REPEATABLE)]
131 }
132
133 #[Attribute(Attribute::TARGET_PARAMETER)]
135 public string $parameter;
136
137 public function __construct(string $parameter) {}
138 }
139
145 #[Attribute(Attribute::TARGET_PROPERTY)]
152 public string $parameter;
153
154 public function __construct(string $parameter) {}
155 }
156
158 final public function no_override(
159 #[ZendTestParameterAttribute("value2")]
160 string $parameter
161 ): int {}
163 #[ZendTestParameterAttribute("value3")]
164 string $parameter
165 ): int {}
166 }
167
174
176 // this attribute must be added internally in MINIT
178 public string $attributed;
179 }
180
182 public function call(): void {}
183 public static function callStatic(): void {}
184 }
185
187 case Foo;
188 case Bar;
189 }
190
191 enum ZendTestStringEnum: string {
192 case Foo = "Test1";
193 case Bar = 'Test2';
194 case Baz = "Test2\\a";
195 case FortyTwo = "42";
196 }
197
198 enum ZendTestIntEnum: int {
199 case Foo = 1;
200 case Bar = 3;
201 case Baz = -1;
202 }
203
204 function zend_test_array_return(): array {}
205
216
218
219 function zend_test_compile_string(string $source_string, string $filename, int $position): void {}
220
222 function zend_test_deprecated(mixed $arg = null): void {}
223
224 #[\Deprecated(message: "custom message")]
226
229
235
237
239
240 function zend_leak_variable(mixed $variable): void {}
241
242 function zend_leak_bytes(int $bytes = 3): void {}
243
244 function zend_string_or_object(object|string $param): object|string {}
245
246 function zend_string_or_object_or_null(object|string|null $param): object|string|null {}
247
250
253
254 function zend_number_or_string(string|int|float $param): string|int|float {}
255
256 function zend_number_or_string_or_null(string|int|float|null $param): string|int|float|null {}
257
258 function zend_iterable(iterable $arg1, ?iterable $arg2 = null): void {}
259
260 function zend_weakmap_attach(object $object, mixed $value): bool {}
263
265
267 #[ZendTestParameterAttribute("value1")]
268 string $parameter
269 ): int {}
270
273
275
276 function zend_call_method(object|string $obj_or_class, string $method, mixed $arg1 = UNKNOWN, mixed $arg2 = UNKNOWN): mixed {}
277
278 function zend_object_init_with_constructor(string $class, mixed ...$args): mixed {}
279
282
284
285#ifdef ZEND_CHECK_STACK_LIMIT
288#endif
289
291
293
294 function zend_test_crash(?string $message = null): void {}
295
297
300
301 function get_open_basedir(): ?string {}
302
303#if defined(HAVE_LIBXML) && !defined(PHP_WIN32)
305#endif
306
308
309#if defined(PHP_WIN32)
311#endif
312
315
316 function zend_test_is_zend_ptr(int $addr): bool {}
317
319}
320
321namespace ZendTestNS {
322
323 class Foo {
325 public function method(): int {}
326 }
327
329 /* This method signature would create a compile error due to the string
330 * "ZendTestNS\UnlikelyCompileError" in the generated macro call */
332 }
333
335 /* This method signature would create a compile error due to the string
336 * "ZendTestNS\NotUnlikelyCompileError" in the generated macro call */
338 }
339}
340
341namespace ZendTestNS2 {
342
344 const ZEND_CONSTANT_A = "namespaced";
345
346 class Foo {
348
349 public function method(): void {}
350 }
351
353
356
359
365}
366
override(#[ZendTestParameterAttribute("value4")] string $parameter)
override(#[ZendTestParameterAttribute("value3")] string $parameter)
no_override(#[ZendTestParameterAttribute("value2")] string $parameter)
ZendSubNS Foo $foo
__construct(string $parameter)
__construct(string $parameter)
const int string TYPED_CLASS_CONST3
Definition test.stub.php:39
static variadicTest(string|Iterator ... $elements)
Definition test.stub.php:68
stdClass Iterator null $classUnionProp
Definition test.stub.php:55
static int $staticIntProp
Definition test.stub.php:51
const int ZEND_TEST_DEPRECATED_ATTR
Definition test.stub.php:47
stdClass $classProp
Definition test.stub.php:54
readonly int $readonlyProp
Definition test.stub.php:57
const mixed TYPED_CLASS_CONST1
Definition test.stub.php:33
const int ZEND_TEST_DEPRECATED
Definition test.stub.php:44
static is_object()
Definition test.stub.php:59
takesUnionType(stdclass|Iterator $arg)
Definition test.stub.php:70
static $_StaticProp
Definition test.stub.php:50
Traversable &Countable $classIntersectionProp
Definition test.stub.php:56
const int array TYPED_CLASS_CONST2
Definition test.stub.php:34
__call(string $name, array $args)
Definition test.stub.php:80
__call(string $name, array $args)
Definition test.stub.php:75
$filename
Definition create.php:9
zval * arg
Definition ffi.c:3975
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
namespaced_aliased_func()
namespaced_deprecated_aliased_func()
namespaced_deprecated_func()
const ZEND_CONSTANT_A
phar_globals readonly
Definition phar.c:3346
$array
Definition test.php:58
zend_test_zend_call_stack_get()
zend_create_unterminated_string(string $str)
zend_string_or_stdclass($param)
zend_test_zend_call_stack_use_all()
zend_test_is_zend_ptr(int $addr)
zend_test_log_err_debug(string $str)
ZendTestIntEnum
@ Baz
zend_test_crash(?string $message=null)
zend_iterable(iterable $arg1, ?iterable $arg2=null)
zend_get_map_ptr_last()
ZendTestUnitEnum
@ Bar
zend_test_is_pcre_bundled()
zend_string_or_object(object|string $param)
zend_test_deprecated(mixed $arg=null)
const ZEND_TEST_DEPRECATED
Definition test.stub.php:15
zend_test_parameter_with_attribute(#[ZendTestParameterAttribute("value1")] string $parameter)
zend_string_or_object_or_null(object|string|null $param)
zend_number_or_string(string|int|float $param)
zend_test_nullable_array_return()
zend_test_array_return()
zend_weakmap_remove(object $object)
zend_test_aliased()
zend_test_zend_ini_parse_uquantity(string $str)
zend_test_void_return()
zend_terminate_string(string &$str)
trait _ZendTestTrait
const ZEND_CONSTANT_A
Definition test.stub.php:18
zend_leak_variable(mixed $variable)
testMethod()
zend_test_create_throwing_resource()
zend_test_fill_packed_array(array &$array)
ZendTestStringEnum
@ FortyTwo
zend_test_zend_ini_parse_quantity(string $str)
zend_test_zend_ini_str()
zend_test_deprecated_aliased()
Traversable Countable $classUnionProp
zend_get_current_func_name()
zend_get_unit_enum()
zend_test_override_libxml_global_state()
zend_string_or_stdclass_or_null($param)
get_open_basedir()
zend_weakmap_dump()
zend_test_compile_string(string $source_string, string $filename, int $position)
zend_object_init_with_constructor(string $class, mixed ... $args)
zend_test_set_fmode(bool $binary)
zend_weakmap_attach(object $object, mixed $value)
zend_test_cast_fread($stream)
zend_test_attribute_with_named_argument()
zend_number_or_string_or_null(string|int|float|null $param)
zend_test_is_string_marked_as_valid_utf8(string $string)
zend_leak_bytes(int $bytes=3)
zend_test_deprecated_attr()
defined(string $constant_name)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
ZEND_API zval * zend_call_method(zend_object *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval_ptr, uint32_t param_count, zval *arg1, zval *arg2)
function(EX_VAR(opline->result.var))
object