diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 2326b8a21f03d..507dc04bcde7f 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -4003,7 +4003,7 @@ uint32_t zend_get_return_info_from_signature_only( const zend_function *func, const zend_script *script, zend_class_entry **ce, bool *ce_is_instanceof) { uint32_t type; - if (func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if (func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && !ZEND_ARG_TYPE_IS_TENTATIVE(func->common.arg_info - 1)) { zend_arg_info *ret_info = func->common.arg_info - 1; type = zend_fetch_arg_info_type(script, ret_info, ce); *ce_is_instanceof = ce != NULL; @@ -4025,15 +4025,16 @@ uint32_t zend_get_return_info_from_signature_only( ZEND_API void zend_init_func_return_info( const zend_op_array *op_array, const zend_script *script, zend_ssa_var_info *ret) { - if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { - zend_ssa_range tmp_range = {0, 0, 0, 0}; - bool is_instanceof = false; - ret->type = zend_get_return_info_from_signature_only( - (zend_function *) op_array, script, &ret->ce, &is_instanceof); - ret->is_instanceof = is_instanceof; - ret->range = tmp_range; - ret->has_range = 0; - } + ZEND_ASSERT((op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)); + ZEND_ASSERT(!ZEND_ARG_TYPE_IS_TENTATIVE(&((zend_function *) op_array)->common.arg_info[-1])); + + zend_ssa_range tmp_range = {0, 0, 0, 0}; + bool is_instanceof = false; + ret->type = zend_get_return_info_from_signature_only( + (zend_function *) op_array, script, &ret->ce, &is_instanceof); + ret->is_instanceof = is_instanceof; + ret->range = tmp_range; + ret->has_range = 0; } void zend_func_return_info(const zend_op_array *op_array, diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index c063267ab90db..9ff0b9ca4c109 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -1446,7 +1446,9 @@ ZEND_API int zend_optimize_script(zend_script *script, zend_long optimization_le func_info = ZEND_FUNC_INFO(call_graph.op_arrays[i]); if (func_info) { func_info->call_map = zend_build_call_map(&ctx.arena, func_info, call_graph.op_arrays[i]); - if (call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if ((call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && + !ZEND_ARG_TYPE_IS_TENTATIVE(&((zend_function *) call_graph.op_arrays[i])->common.arg_info[-1]) + ) { zend_init_func_return_info(call_graph.op_arrays[i], script, &func_info->return_info); } } diff --git a/Zend/tests/bug21478.phpt b/Zend/tests/bug21478.phpt index 2738b7964dd8a..b111e717a5a04 100644 --- a/Zend/tests/bug21478.phpt +++ b/Zend/tests/bug21478.phpt @@ -3,7 +3,7 @@ Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault) --FILE-- data = strtoupper($bucket->data); stream_bucket_append($out, $bucket); diff --git a/Zend/tests/bug78406.phpt b/Zend/tests/bug78406.phpt index 64fd2a1945085..1524b8af57557 100644 --- a/Zend/tests/bug78406.phpt +++ b/Zend/tests/bug78406.phpt @@ -10,7 +10,7 @@ if (!class_exists(SampleFilter::class)) { { private $data = ''; - public function filter($in, $out, &$consumed, $closing) + public function filter($in, $out, &$consumed, $closing): int { while ($bucket = stream_bucket_make_writeable($in)) { diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt index 016ca6107fee1..12ed0d3d445ab 100644 --- a/Zend/tests/enum/json_encode.phpt +++ b/Zend/tests/enum/json_encode.phpt @@ -18,7 +18,7 @@ enum StringFoo: string { enum CustomFoo implements JsonSerializable { case Bar; - public function jsonSerialize() { + public function jsonSerialize(): mixed { return 'Custom ' . $this->name; } } diff --git a/Zend/tests/foreach_004.phpt b/Zend/tests/foreach_004.phpt index 8a7b915c2e969..154924bb6733c 100644 --- a/Zend/tests/foreach_004.phpt +++ b/Zend/tests/foreach_004.phpt @@ -16,10 +16,26 @@ class IT extends ArrayIterator { } } - function rewind() {$this->trap(__FUNCTION__); return parent::rewind();} - function valid() {$this->trap(__FUNCTION__); return parent::valid();} - function key() {$this->trap(__FUNCTION__); return parent::key();} - function next() {$this->trap(__FUNCTION__); return parent::next();} + function rewind(): void + { + $this->trap(__FUNCTION__); + parent::rewind(); + } + + function valid(): bool { + $this->trap(__FUNCTION__); + return parent::valid(); + } + + function key(): mixed { + $this->trap(__FUNCTION__); + return parent::key(); + } + + function next(): void { + $this->trap(__FUNCTION__); + parent::next(); + } } foreach(['rewind', 'valid', 'key', 'next'] as $trap) { diff --git a/Zend/tests/iterator_key_by_ref.phpt b/Zend/tests/iterator_key_by_ref.phpt index 3bd2bcfdb29d1..7366b644d898d 100644 --- a/Zend/tests/iterator_key_by_ref.phpt +++ b/Zend/tests/iterator_key_by_ref.phpt @@ -3,7 +3,7 @@ Iterator::key() with by-ref return --FILE-- --EXPECTF-- -Fatal error: Declaration of MyDateTimeZone::listIdentifiers() must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) in %s on line %d +Fatal error: Declaration of MyDateTimeZone::listIdentifiers(): array must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d diff --git a/Zend/tests/parameter_default_values/internal_declaration_error_const.phpt b/Zend/tests/parameter_default_values/internal_declaration_error_const.phpt index 9335abd5d6a91..5b0a9bf05f0f0 100644 --- a/Zend/tests/parameter_default_values/internal_declaration_error_const.phpt +++ b/Zend/tests/parameter_default_values/internal_declaration_error_const.phpt @@ -4,10 +4,10 @@ The default value is a constant in the parent class method's signature. --EXPECTF-- -Fatal error: Declaration of MyDateTimeZone::getTransitions() must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX) in %s on line %d +Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false in %s on line %d diff --git a/Zend/tests/parameter_default_values/internal_declaration_error_false.phpt b/Zend/tests/parameter_default_values/internal_declaration_error_false.phpt index 80c98a405253a..d84b214a1a7b4 100644 --- a/Zend/tests/parameter_default_values/internal_declaration_error_false.phpt +++ b/Zend/tests/parameter_default_values/internal_declaration_error_false.phpt @@ -5,8 +5,8 @@ The default value is false in the parent class method's signature. interface MyDateTimeInterface extends DateTimeInterface { - public function diff(); + public function diff(): DateInterval|false; } ?> --EXPECTF-- -Fatal error: Declaration of MyDateTimeInterface::diff() must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false) in %s on line %d +Fatal error: Declaration of MyDateTimeInterface::diff(): DateInterval|false must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval|false in %s on line %d diff --git a/Zend/tests/parameter_default_values/internal_declaration_error_int.phpt b/Zend/tests/parameter_default_values/internal_declaration_error_int.phpt index c32cc9e41fbc1..edf71c0263fea 100644 --- a/Zend/tests/parameter_default_values/internal_declaration_error_int.phpt +++ b/Zend/tests/parameter_default_values/internal_declaration_error_int.phpt @@ -4,10 +4,10 @@ The default value is an integer in the parent class method's signature. --EXPECTF-- -Fatal error: Declaration of MyDateTime::setTime(int $hour, int $minute, int $second = 0, bool $microsecond = false) must be compatible with DateTime::setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0) in %s on line %d +Fatal error: Declaration of MyDateTime::setTime(int $hour, int $minute, int $second = 0, bool $microsecond = false): DateTime must be compatible with DateTime::setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime in %s on line %d diff --git a/Zend/tests/parameter_default_values/internal_declaration_error_null.phpt b/Zend/tests/parameter_default_values/internal_declaration_error_null.phpt index 3804c2a6e1557..ebe5e142155ac 100644 --- a/Zend/tests/parameter_default_values/internal_declaration_error_null.phpt +++ b/Zend/tests/parameter_default_values/internal_declaration_error_null.phpt @@ -4,10 +4,10 @@ The default value is null in the parent class method's signature. --EXPECTF-- -Fatal error: Declaration of MyDateTime::createFromFormat() must be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null) in %s on line %d +Fatal error: Declaration of MyDateTime::createFromFormat(): DateTime|false must be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false in %s on line %d diff --git a/Zend/tests/type_declarations/variance/internal_parent/compatible_return_type.phpt b/Zend/tests/type_declarations/variance/internal_parent/compatible_return_type.phpt new file mode 100644 index 0000000000000..a45e3f4eb942f --- /dev/null +++ b/Zend/tests/type_declarations/variance/internal_parent/compatible_return_type.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test that no notice is emitted when the return type/value of the overriding method is compatible with the tentative return type/value of the overridden method +--FILE-- + +--EXPECT-- +array(0) { +} diff --git a/Zend/tests/type_declarations/variance/internal_parent/incompatible_return_type.phpt b/Zend/tests/type_declarations/variance/internal_parent/incompatible_return_type.phpt new file mode 100644 index 0000000000000..8c40a46a86608 --- /dev/null +++ b/Zend/tests/type_declarations/variance/internal_parent/incompatible_return_type.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test that a notice is emitted when the return type/value of the overriding method is incompatible with the tentative return type/value of the overridden method +--FILE-- + +--EXPECTF-- +Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): string should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d +string(0) "" diff --git a/Zend/tests/type_declarations/variance/internal_parent.phpt b/Zend/tests/type_declarations/variance/internal_parent/internal_parent.phpt similarity index 80% rename from Zend/tests/type_declarations/variance/internal_parent.phpt rename to Zend/tests/type_declarations/variance/internal_parent/internal_parent.phpt index c82e10ffc34d5..ec59ceb2c71fd 100644 --- a/Zend/tests/type_declarations/variance/internal_parent.phpt +++ b/Zend/tests/type_declarations/variance/internal_parent/internal_parent.phpt @@ -9,4 +9,4 @@ class Test extends DateTime { ?> --EXPECTF-- -Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, ?Wrong $timezone = null) and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null), because class Wrong is not available in %s on line %d +Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, ?Wrong $timezone = null) and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d diff --git a/Zend/tests/type_declarations/variance/internal_parent/internal_parent2.phpt b/Zend/tests/type_declarations/variance/internal_parent/internal_parent2.phpt new file mode 100644 index 0000000000000..5580ff62cace6 --- /dev/null +++ b/Zend/tests/type_declarations/variance/internal_parent/internal_parent2.phpt @@ -0,0 +1,12 @@ +--TEST-- +Internal class as parent +--FILE-- + +--EXPECTF-- +Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, $timezone = null): Wrong and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d diff --git a/Zend/tests/type_declarations/variance/internal_parent/missing_return_type.phpt b/Zend/tests/type_declarations/variance/internal_parent/missing_return_type.phpt new file mode 100644 index 0000000000000..c20255df15c56 --- /dev/null +++ b/Zend/tests/type_declarations/variance/internal_parent/missing_return_type.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test that a notice is emitted when the tentative return type of the overridden method is omitted +--FILE-- + +--EXPECTF-- +Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d diff --git a/Zend/tests/type_declarations/variance/suppressed_incompatible_return_type.phpt b/Zend/tests/type_declarations/variance/suppressed_incompatible_return_type.phpt new file mode 100644 index 0000000000000..5da5f8d513032 --- /dev/null +++ b/Zend/tests/type_declarations/variance/suppressed_incompatible_return_type.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test that the notice can be suppressed when the return type/value of the overriding method is incompatible with the tentative return type/value of the overridden method +--FILE-- +modify("+1 sec")); +?> +--EXPECT-- +bool(false) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 50764faeca367..732726e24bea1 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -107,66 +107,97 @@ typedef struct _zend_fcall_info_cache { #define ZEND_FE_END { NULL, NULL, NULL, 0, 0 } -#define _ZEND_ARG_INFO_FLAGS(pass_by_ref, is_variadic) \ - (((pass_by_ref) << _ZEND_SEND_MODE_SHIFT) | ((is_variadic) ? _ZEND_IS_VARIADIC_BIT : 0)) +#define _ZEND_ARG_INFO_FLAGS(pass_by_ref, is_variadic, is_tentative) \ + (((pass_by_ref) << _ZEND_SEND_MODE_SHIFT) | ((is_variadic) ? _ZEND_IS_VARIADIC_BIT : 0) | ((is_tentative) ? _ZEND_IS_TENTATIVE_BIT : 0)) /* Arginfo structures without type information */ #define ZEND_ARG_INFO(pass_by_ref, name) \ - { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL }, + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, #define ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) \ - { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value }, + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, #define ZEND_ARG_VARIADIC_INFO(pass_by_ref, name) \ - { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 1)), NULL }, + { #name, ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, /* Arginfo structures with simple type information */ #define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) \ - { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL }, + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, #define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ - { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value }, + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, #define ZEND_ARG_VARIADIC_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) \ - { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1)), NULL }, + { #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, /* Arginfo structures with complex type information */ #define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ - { #name, ZEND_TYPE_INIT_MASK(type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value }, + { #name, ZEND_TYPE_INIT_MASK(type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, #define ZEND_ARG_OBJ_TYPE_MASK(pass_by_ref, name, class_name, type_mask, default_value) \ - { #name, ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value }, + { #name, ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type_mask | _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, /* Arginfo structures with object type information */ #define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ - { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL }, + { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, #define ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, classname, allow_null, default_value) \ - { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value }, + { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), default_value }, #define ZEND_ARG_VARIADIC_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ - { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1)), NULL }, + { #name, ZEND_TYPE_INIT_CLASS_CONST(#classname, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 1, 0)), NULL }, /* Legacy arginfo structures */ #define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) \ - { #name, ZEND_TYPE_INIT_CODE(IS_ARRAY, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL }, + { #name, ZEND_TYPE_INIT_CODE(IS_ARRAY, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, #define ZEND_ARG_CALLABLE_INFO(pass_by_ref, name, allow_null) \ - { #name, ZEND_TYPE_INIT_CODE(IS_CALLABLE, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL }, + { #name, ZEND_TYPE_INIT_CODE(IS_CALLABLE, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)), NULL }, -#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, is_tentative_return_type) \ static const zend_internal_arg_info name[] = { \ { (const char*)(zend_uintptr_t)(required_num_args), \ - ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0)), NULL }, + ZEND_TYPE_INIT_CLASS_CONST(#class_name, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, return_reference, required_num_args, class_name, allow_null, 1) #define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(name, class_name, allow_null) \ - ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, 0, -1, class_name, allow_null) + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, 0, -1, class_name, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO(name, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX2(name, 0, -1, class_name, allow_null, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, is_tentative_return_type) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_MASK(type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, #define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX2(name, return_reference, required_num_args, type, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, is_tentative_return_type) \ static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_MASK(type | _ZEND_ARG_INFO_FLAGS(return_reference, 0)), NULL }, + { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type | _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, #define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(name, return_reference, required_num_args, class_name, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(name, return_reference, required_num_args, class_name, type) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX2(name, return_reference, required_num_args, class_name, type, 1) + +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, is_tentative_return_type) \ static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST_MASK(#class_name, type | _ZEND_ARG_INFO_FLAGS(return_reference, 0)), NULL }, + { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0, is_tentative_return_type)), NULL }, #define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ - static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(return_reference, 0)), NULL }, + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, return_reference, required_num_args, type, allow_null, 1) + #define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(name, type, allow_null) \ - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, 0, -1, type, allow_null) + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, 0, -1, type, allow_null, 0) + +#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO(name, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX2(name, 0, -1, type, allow_null, 1) #define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \ static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(return_reference, 0)), NULL }, + { (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(return_reference, 0, 0)), NULL }, #define ZEND_BEGIN_ARG_INFO(name, _unused) \ ZEND_BEGIN_ARG_INFO_EX(name, {}, ZEND_RETURN_VALUE, -1) #define ZEND_END_ARG_INFO() }; diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index 2823d3bafb3ea..c323e9dc3ff43 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -24,6 +24,7 @@ #include "zend_smart_str.h" ZEND_API zend_class_entry *zend_ce_attribute; +ZEND_API zend_class_entry *zend_ce_return_type_will_change_attribute; static HashTable internal_attributes; @@ -55,6 +56,13 @@ void validate_attribute(zend_attribute *attr, uint32_t target, zend_class_entry } } +void validate_return_type_will_change_attribute(zend_attribute *attr, uint32_t target, zend_class_entry *scope) +{ + if (target != ZEND_ATTRIBUTE_TARGET_METHOD) { + zend_error(E_COMPILE_ERROR, "Only methods can be marked with #[ReturnTypeWillChange]"); + } +} + ZEND_METHOD(Attribute, __construct) { zend_long flags = ZEND_ATTRIBUTE_TARGET_ALL; @@ -67,6 +75,11 @@ ZEND_METHOD(Attribute, __construct) ZVAL_LONG(OBJ_PROP_NUM(Z_OBJ_P(ZEND_THIS), 0), flags); } +ZEND_METHOD(ReturnTypeWillChange, __construct) +{ + ZEND_PARSE_PARAMETERS_NONE(); +} + static zend_attribute *get_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset) { if (attributes) { @@ -278,6 +291,10 @@ void zend_register_attribute_ce(void) zend_declare_class_constant_long(zend_ce_attribute, ZEND_STRL("TARGET_PARAMETER"), ZEND_ATTRIBUTE_TARGET_PARAMETER); zend_declare_class_constant_long(zend_ce_attribute, ZEND_STRL("TARGET_ALL"), ZEND_ATTRIBUTE_TARGET_ALL); zend_declare_class_constant_long(zend_ce_attribute, ZEND_STRL("IS_REPEATABLE"), ZEND_ATTRIBUTE_IS_REPEATABLE); + + zend_ce_return_type_will_change_attribute = register_class_ReturnTypeWillChange(); + attr = zend_internal_attribute_register(zend_ce_return_type_will_change_attribute, ZEND_ATTRIBUTE_TARGET_METHOD); + attr->validator = validate_return_type_will_change_attribute; } void zend_attributes_shutdown(void) diff --git a/Zend/zend_attributes.stub.php b/Zend/zend_attributes.stub.php index 26defa8d4db60..70b0c49aeb9f2 100644 --- a/Zend/zend_attributes.stub.php +++ b/Zend/zend_attributes.stub.php @@ -8,3 +8,8 @@ final class Attribute public function __construct(int $flags = Attribute::TARGET_ALL) {} } + +final class ReturnTypeWillChange +{ + public function __construct() {} +} diff --git a/Zend/zend_attributes_arginfo.h b/Zend/zend_attributes_arginfo.h index a09f9161fd61e..5f62eb8fd057d 100644 --- a/Zend/zend_attributes_arginfo.h +++ b/Zend/zend_attributes_arginfo.h @@ -1,12 +1,16 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0183e750e66999862a7688ecb251017110d06d1f */ + * Stub hash: 3fd949e1b9f49666bed3081ed1e8e711acd9f49c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Attribute___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "Attribute::TARGET_ALL") ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReturnTypeWillChange___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + ZEND_METHOD(Attribute, __construct); +ZEND_METHOD(ReturnTypeWillChange, __construct); static const zend_function_entry class_Attribute_methods[] = { @@ -14,6 +18,12 @@ static const zend_function_entry class_Attribute_methods[] = { ZEND_FE_END }; + +static const zend_function_entry class_ReturnTypeWillChange_methods[] = { + ZEND_ME(ReturnTypeWillChange, __construct, arginfo_class_ReturnTypeWillChange___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + static zend_class_entry *register_class_Attribute(void) { zend_class_entry ce, *class_entry; @@ -30,3 +40,14 @@ static zend_class_entry *register_class_Attribute(void) return class_entry; } + +static zend_class_entry *register_class_ReturnTypeWillChange(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "ReturnTypeWillChange", class_ReturnTypeWillChange_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL; + + return class_entry; +} diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 884f653ed7245..a6b32b3f099e9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1305,7 +1305,7 @@ static void zend_mark_function_as_generator() /* {{{ */ "The \"yield\" expression can only be used inside a function"); } - if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE && !ZEND_ARG_TYPE_IS_TENTATIVE(&(CG(active_op_array))->arg_info[-1])) { zend_type return_type = CG(active_op_array)->arg_info[-1].type; bool valid_type = (ZEND_TYPE_FULL_MASK(return_type) & (MAY_BE_ITERABLE | MAY_BE_OBJECT)) != 0; if (!valid_type) { @@ -2424,7 +2424,7 @@ static void zend_emit_return_type_check( znode *expr, zend_arg_info *return_info, bool implicit) /* {{{ */ { zend_type type = return_info->type; - if (ZEND_TYPE_IS_SET(type)) { + if (ZEND_TYPE_IS_SET(type) && !ZEND_ARG_TYPE_IS_TENTATIVE(return_info)) { zend_op *opline; /* `return ...;` is illegal in a void function (but `return;` isn't) */ @@ -6476,7 +6476,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall arg_infos->type = zend_compile_typename( return_type_ast, /* force_allow_null */ 0); ZEND_TYPE_FULL_MASK(arg_infos->type) |= _ZEND_ARG_INFO_FLAGS( - (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0, /* is_variadic */ 0); + (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0, /* is_variadic */ 0, 0); } else { arg_infos->type = (zend_type) ZEND_TYPE_INIT_CODE(fallback_return_type, 0, 0); } @@ -6606,7 +6606,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall zend_alloc_cache_slots(zend_type_get_num_classes(arg_info->type)); } - uint32_t arg_info_flags = _ZEND_ARG_INFO_FLAGS(is_ref, is_variadic) + uint32_t arg_info_flags = _ZEND_ARG_INFO_FLAGS(is_ref, is_variadic, 0) | (visibility ? _ZEND_IS_PROMOTED_BIT : 0); ZEND_TYPE_FULL_MASK(arg_info->type) |= arg_info_flags; if (opcode == ZEND_RECV) { diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 6291e4397b883..5c60a22086730 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -983,16 +983,19 @@ ZEND_API zend_string *zend_type_to_string(zend_type type); #define ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS 1 -/* The send mode and is_variadic flag are stored as part of zend_type */ +/* The send mode, the is_variadic, the is_promoted, and the is_tentative flags are stored as part of zend_type */ #define _ZEND_SEND_MODE_SHIFT _ZEND_TYPE_EXTRA_FLAGS_SHIFT #define _ZEND_IS_VARIADIC_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 2)) #define _ZEND_IS_PROMOTED_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 3)) +#define _ZEND_IS_TENTATIVE_BIT (1 << (_ZEND_TYPE_EXTRA_FLAGS_SHIFT + 4)) #define ZEND_ARG_SEND_MODE(arg_info) \ ((ZEND_TYPE_FULL_MASK((arg_info)->type) >> _ZEND_SEND_MODE_SHIFT) & 3) #define ZEND_ARG_IS_VARIADIC(arg_info) \ ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_VARIADIC_BIT) != 0) #define ZEND_ARG_IS_PROMOTED(arg_info) \ ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_PROMOTED_BIT) != 0) +#define ZEND_ARG_TYPE_IS_TENTATIVE(arg_info) \ + ((ZEND_TYPE_FULL_MASK((arg_info)->type) & _ZEND_IS_TENTATIVE_BIT) != 0) #define ZEND_DIM_IS (1 << 0) /* isset fetch needed for null coalesce */ #define ZEND_DIM_ALTERNATIVE_SYNTAX (1 << 1) /* deprecated curly brace usage */ diff --git a/Zend/zend_exceptions.stub.php b/Zend/zend_exceptions.stub.php index be00b6b65dbea..9791574231393 100644 --- a/Zend/zend_exceptions.stub.php +++ b/Zend/zend_exceptions.stub.php @@ -6,7 +6,10 @@ interface Throwable extends Stringable { public function getMessage(): string; - /** @return int */ + /** + * @return int + * @no-generate-tentative-return-type + */ public function getCode(); public function getFile(): string; @@ -41,7 +44,10 @@ public function __wakeup() {} final public function getMessage(): string {} - /** @return int */ + /** + * @return int + * @no-generate-tentative-return-type + */ final public function getCode() {} final public function getFile(): string {} @@ -103,6 +109,7 @@ final public function getMessage(): string {} /** * @return int * @implementation-alias Exception::getCode + * @no-generate-tentative-return-type */ final public function getCode() {} diff --git a/Zend/zend_exceptions_arginfo.h b/Zend/zend_exceptions_arginfo.h index 4779d698e1980..61f3be68e48a5 100644 --- a/Zend/zend_exceptions_arginfo.h +++ b/Zend/zend_exceptions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9a9ce2975a7449a621d364beca646525fc56b294 */ + * Stub hash: c3d9ef0c553b1ec3bd9927987226d76ce4a1b342 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -29,7 +29,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Exception___construct, 0, 0, 0) ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_Exception___wakeup arginfo_class_Throwable_getCode +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Exception___wakeup, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() #define arginfo_class_Exception_getMessage arginfo_class_Throwable_getMessage @@ -62,7 +63,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_Error___construct arginfo_class_Exception___construct -#define arginfo_class_Error___wakeup arginfo_class_Throwable_getCode +#define arginfo_class_Error___wakeup arginfo_class_Exception___wakeup #define arginfo_class_Error_getMessage arginfo_class_Throwable_getMessage diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 151eb4ecc59a3..2ab88f7f54831 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1294,17 +1294,19 @@ static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, con static bool zend_verify_internal_return_type(zend_function *zf, zval *ret) { zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1; - if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_VOID) { - if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) { - zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); - return 0; + if (!ZEND_ARG_TYPE_IS_TENTATIVE(ret_info)) { + if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_VOID) { + if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) { + zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); + return 0; + } + return 1; } - return 1; - } - if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, /* cache_slot */ NULL, NULL, 1, /* is_internal */ 1))) { - zend_verify_internal_return_error(zf, ret); - return 0; + if (UNEXPECTED(!zend_check_type(&ret_info->type, ret, /* cache_slot */ NULL, NULL, 1, /* is_internal */ 1))) { + zend_verify_internal_return_error(zf, ret); + return 0; + } } return 1; diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 04ec5dc3c61ab..4aabeb646118b 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -27,10 +27,21 @@ #include "zend_operators.h" #include "zend_exceptions.h" #include "zend_enum.h" +#include "zend_attributes.h" ZEND_API zend_class_entry* (*zend_inheritance_cache_get)(zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces) = NULL; ZEND_API zend_class_entry* (*zend_inheritance_cache_add)(zend_class_entry *ce, zend_class_entry *proto, zend_class_entry *parent, zend_class_entry **traits_and_interfaces, HashTable *dependencies) = NULL; +/* Unresolved means that class declarations that are currently not available are needed to + * determine whether the inheritance is valid or not. At runtime UNRESOLVED should be treated + * as an ERROR. */ +typedef enum { + INHERITANCE_UNRESOLVED = -1, + INHERITANCE_ERROR = 0, + INHERITANCE_WARNING = 1, + INHERITANCE_SUCCESS = 2, +} inheritance_status; + static void add_dependency_obligation(zend_class_entry *ce, zend_class_entry *dependency_ce); static void add_compatibility_obligation( zend_class_entry *ce, const zend_function *child_fn, zend_class_entry *child_scope, @@ -39,7 +50,12 @@ static void add_property_compatibility_obligation( zend_class_entry *ce, const zend_property_info *child_prop, const zend_property_info *parent_prop); -static void zend_type_copy_ctor(zend_type *type, bool persistent) { +static void ZEND_COLD emit_incompatible_method_error( + const zend_function *child, zend_class_entry *child_scope, + const zend_function *parent, zend_class_entry *parent_scope, + inheritance_status status); + +static void zend_type_copy_ctor(zend_type *type, zend_bool persistent) { if (ZEND_TYPE_HAS_LIST(*type)) { zend_type_list *old_list = ZEND_TYPE_LIST(*type); size_t size = ZEND_TYPE_LIST_SIZE(old_list->num_types); @@ -320,16 +336,6 @@ static bool zend_type_permits_self( return 0; } -/* Unresolved means that class declarations that are currently not available are needed to - * determine whether the inheritance is valid or not. At runtime UNRESOLVED should be treated - * as an ERROR. */ -typedef enum { - INHERITANCE_UNRESOLVED = -1, - INHERITANCE_ERROR = 0, - INHERITANCE_SUCCESS = 1, -} inheritance_status; - - static void track_class_dependency(zend_class_entry *ce, zend_string *class_name) { HashTable *ht; @@ -432,7 +438,7 @@ static inheritance_status zend_perform_covariant_class_type_check( static inheritance_status zend_perform_covariant_type_check( zend_class_entry *fe_scope, zend_type fe_type, - zend_class_entry *proto_scope, zend_type proto_type) /* {{{ */ + zend_class_entry *proto_scope, zend_type proto_type, bool tentative) /* {{{ */ { ZEND_ASSERT(ZEND_TYPE_IS_SET(fe_type) && ZEND_TYPE_IS_SET(proto_type)); @@ -473,7 +479,7 @@ static inheritance_status zend_perform_covariant_type_check( if (added_types) { /* Otherwise adding new types is illegal */ - return INHERITANCE_ERROR; + return tentative ? INHERITANCE_WARNING : INHERITANCE_ERROR; } } @@ -499,7 +505,7 @@ static inheritance_status zend_perform_covariant_type_check( } if (status == INHERITANCE_ERROR) { - return INHERITANCE_ERROR; + return tentative ? INHERITANCE_WARNING : INHERITANCE_ERROR; } if (status != INHERITANCE_SUCCESS) { all_success = 0; @@ -547,7 +553,7 @@ static inheritance_status zend_do_perform_arg_type_hint_check( /* Contravariant type check is performed as a covariant type check with swapped * argument order. */ return zend_perform_covariant_type_check( - proto_scope, proto_arg_info->type, fe_scope, fe_arg_info->type); + proto_scope, proto_arg_info->type, fe_scope, fe_arg_info->type, 0); } /* }}} */ @@ -637,18 +643,25 @@ static inheritance_status zend_do_perform_implementation_check( /* Check return type compatibility, but only if the prototype already specifies * a return type. Adding a new return type is always valid. */ if (proto->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { - /* Removing a return type is not valid. */ + /* Removing a return type is not valid, unless the parent return type is tentative. */ if (!(fe->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { - return INHERITANCE_ERROR; + if (ZEND_ARG_TYPE_IS_TENTATIVE(&proto->common.arg_info[-1])) { + if (status == INHERITANCE_SUCCESS) { + emit_incompatible_method_error(fe, fe_scope, proto, proto_scope, INHERITANCE_WARNING); + } + return status; + } else { + return INHERITANCE_ERROR; + } } local_status = zend_perform_covariant_type_check( fe_scope, fe->common.arg_info[-1].type, - proto_scope, proto->common.arg_info[-1].type); + proto_scope, proto->common.arg_info[-1].type, ZEND_ARG_TYPE_IS_TENTATIVE(&proto->common.arg_info[-1])); if (UNEXPECTED(local_status != INHERITANCE_SUCCESS)) { - if (UNEXPECTED(local_status == INHERITANCE_ERROR)) { - return INHERITANCE_ERROR; + if (UNEXPECTED(local_status == INHERITANCE_ERROR || local_status == INHERITANCE_WARNING)) { + return local_status; } ZEND_ASSERT(local_status == INHERITANCE_UNRESOLVED); status = INHERITANCE_UNRESOLVED; @@ -831,6 +844,18 @@ static void ZEND_COLD emit_incompatible_method_error( zend_error_at(E_COMPILE_ERROR, NULL, func_lineno(child), "Could not check compatibility between %s and %s, because class %s is not available", ZSTR_VAL(child_prototype), ZSTR_VAL(parent_prototype), ZSTR_VAL(unresolved_class)); + } else if (status == INHERITANCE_WARNING) { + zend_attribute *return_type_will_change_attribute = zend_get_attribute_str( + child->common.attributes, + "returntypewillchange", + sizeof("returntypewillchange")-1 + ); + + if (!return_type_will_change_attribute) { + zend_error_at(E_DEPRECATED, NULL, func_lineno(child), + "Declaration of %s should be compatible with %s", + ZSTR_VAL(child_prototype), ZSTR_VAL(parent_prototype)); + } } else { zend_error_at(E_COMPILE_ERROR, NULL, func_lineno(child), "Declaration of %s must be compatible with %s", @@ -851,7 +876,7 @@ static void perform_delayable_implementation_check( if (EXPECTED(status == INHERITANCE_UNRESOLVED)) { add_compatibility_obligation(ce, fe, fe_scope, proto, proto_scope); } else { - ZEND_ASSERT(status == INHERITANCE_ERROR); + ZEND_ASSERT(status == INHERITANCE_ERROR || status == INHERITANCE_WARNING); emit_incompatible_method_error(fe, fe_scope, proto, proto_scope, status); } } @@ -1025,9 +1050,9 @@ inheritance_status property_types_compatible( /* Perform a covariant type check in both directions to determined invariance. */ inheritance_status status1 = zend_perform_covariant_type_check( - child_info->ce, child_info->type, parent_info->ce, parent_info->type); + child_info->ce, child_info->type, parent_info->ce, parent_info->type, 0); inheritance_status status2 = zend_perform_covariant_type_check( - parent_info->ce, parent_info->type, child_info->ce, child_info->type); + parent_info->ce, parent_info->type, child_info->ce, child_info->type, 0); if (status1 == INHERITANCE_SUCCESS && status2 == INHERITANCE_SUCCESS) { return INHERITANCE_SUCCESS; } diff --git a/build/gen_stub.php b/build/gen_stub.php index 084e142e34598..d545a3b545144 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -205,6 +205,17 @@ public function toTypeCode(): string { } } + public function isValidTypeCode(): bool + { + try { + $this->toTypeCode(); + } catch (Throwable $exception) { + return false; + } + + return true; + } + public function toTypeMask() { assert($this->isBuiltin); switch (strtolower($this->name)) { @@ -373,6 +384,16 @@ public function toTypeMask(): string { return $type->toTypeMask(); }, $this->builtinTypes)); } + + public function isValidTypeMask(): bool { + try { + $this->toTypeMask(); + } catch (Throwable $exception) { + return false; + } + + return true; + } } class ArgInfo { @@ -599,16 +620,20 @@ class ReturnInfo { public $type; /** @var Type|null */ public $phpDocType; + /** @var bool */ + public $generateTentativeReturnType; - public function __construct(bool $byRef, ?Type $type, ?Type $phpDocType) { + public function __construct(bool $byRef, ?Type $type, ?Type $phpDocType, bool $generateTentativeReturnType) { $this->byRef = $byRef; $this->type = $type; $this->phpDocType = $phpDocType; + $this->generateTentativeReturnType = $generateTentativeReturnType; } public function equals(ReturnInfo $other): bool { return $this->byRef === $other->byRef - && Type::equals($this->type, $other->type); + && Type::equals($this->type, $other->type) + && Type::equals($this->phpDocType, $other->phpDocType); } public function getMethodSynopsisType(): ?Type { @@ -1431,6 +1456,7 @@ function parseFunctionLike( $isDeprecated = false; $verify = true; $docReturnType = null; + $generateTentativeReturnType = true; $docParamTypes = []; if ($comment) { @@ -1452,8 +1478,10 @@ function parseFunctionLike( } } else if ($tag->name === 'deprecated') { $isDeprecated = true; - } else if ($tag->name === 'no-verify') { + } else if ($tag->name === 'no-verify') { $verify = false; + } else if ($tag->name === 'no-generate-tentative-return-type') { + $generateTentativeReturnType = false; } else if ($tag->name === 'return') { $docReturnType = $tag->getType(); } else if ($tag->name === 'param') { @@ -1530,7 +1558,8 @@ function parseFunctionLike( $return = new ReturnInfo( $func->returnsByRef(), $returnType ? Type::fromNode($returnType) : null, - $docReturnType ? Type::fromPhpDoc($docReturnType) : null + $docReturnType ? Type::fromPhpDoc($docReturnType) : null, + $generateTentativeReturnType ); return new FuncInfo( @@ -1813,19 +1842,27 @@ protected function pName_FullyQualified(Name\FullyQualified $node) { function funcInfoToCode(FuncInfo $funcInfo): string { $code = ''; - $returnType = $funcInfo->return->type; + $nativeReturnType = $funcInfo->return->type; + $phpDocReturnType = $funcInfo->isMethod() && $funcInfo->return->generateTentativeReturnType ? $funcInfo->return->phpDocType : null; + $returnType = $nativeReturnType ?? $phpDocReturnType; + $returnCode = ""; + if ($returnType !== null) { if (null !== $simpleReturnType = $returnType->tryToSimpleType()) { if ($simpleReturnType->isBuiltin) { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(%s, %d, %d, %s, %d)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $simpleReturnType->toTypeCode(), $returnType->isNullable() - ); + if ($simpleReturnType->isValidTypeCode()) { + $returnCode = sprintf( + "%s(%s, %d, %d, %s, %d)\n", + $nativeReturnType ? "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" : "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $simpleReturnType->toTypeCode(), $returnType->isNullable() + ); + } } else { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(%s, %d, %d, %s, %d)\n", + $returnCode = sprintf( + "%s(%s, %d, %d, %s, %d)\n", + $nativeReturnType ? "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX" : "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX", $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs, $simpleReturnType->toEscapedName(), $returnType->isNullable() @@ -1833,27 +1870,35 @@ function funcInfoToCode(FuncInfo $funcInfo): string { } } else { $arginfoType = $returnType->toArginfoType(); - if ($arginfoType->hasClassType()) { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(%s, %d, %d, %s, %s)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $arginfoType->toClassTypeString(), $arginfoType->toTypeMask() - ); - } else { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(%s, %d, %d, %s)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $arginfoType->toTypeMask() - ); + if ($arginfoType->isValidTypeMask()) { + if ($arginfoType->hasClassType()) { + $returnCode = sprintf( + "%s(%s, %d, %d, %s, %s)\n", + $nativeReturnType ? "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX" : "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toClassTypeString(), $arginfoType->toTypeMask() + ); + } else { + $returnCode = sprintf( + "%s(%s, %d, %d, %s)\n", + $nativeReturnType ? "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX" : "ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toTypeMask() + ); + } } } - } else { + } + + if ($returnCode === "") { $code .= sprintf( "ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs ); + } else { + $code .= $returnCode; } foreach ($funcInfo->args as $argInfo) { diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index db00909d99b1a..afab1dc069ba0 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -336,7 +336,7 @@ static zend_function *com_method_get(zend_object **object_ptr, zend_string *name for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) { bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0; - f.arg_info[i].type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(by_ref, 0)); + f.arg_info[i].type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(by_ref, 0, 0)); } f.num_args = bindptr.lpfuncdesc->cParams; diff --git a/ext/curl/curl_file_arginfo.h b/ext/curl/curl_file_arginfo.h index ee6f6309e110f..731caa0bc9910 100644 --- a/ext/curl/curl_file_arginfo.h +++ b/ext/curl/curl_file_arginfo.h @@ -7,18 +7,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, posted_filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_getFilename, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_CURLFile_getFilename, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_CURLFile_getMimeType arginfo_class_CURLFile_getFilename #define arginfo_class_CURLFile_getPostFilename arginfo_class_CURLFile_getFilename -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setMimeType, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_CURLFile_setMimeType, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, mime_type, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setPostFilename, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_CURLFile_setPostFilename, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, posted_filename, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h index 8f90dd8cbadd6..af0ba115bc460 100644 --- a/ext/date/php_date_arginfo.h +++ b/ext/date/php_date_arginfo.h @@ -225,36 +225,39 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_date_sun_info, 0, 3, IS_ARRAY, 0 ZEND_ARG_TYPE_INFO(0, longitude, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeInterface_format, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeInterface_format, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeInterface_getTimezone, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTimeInterface_getTimezone, 0, 0, DateTimeZone, MAY_BE_FALSE) ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeInterface_getOffset arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeInterface_getOffset, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeInterface_getTimestamp arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DateTimeInterface_getTimestamp, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeInterface_diff, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTimeInterface_diff, 0, 1, DateInterval, MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, targetObject, DateTimeInterface, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, absolute, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeInterface___wakeup arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeInterface___wakeup, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, datetime, IS_STRING, 0, "\"now\"") ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, timezone, DateTimeZone, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_DateTime___wakeup arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTime___wakeup arginfo_class_DateTimeInterface___wakeup -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime___set_state, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime___set_state, 0, 1, DateTime, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_createFromImmutable, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_createFromImmutable, 0, 1, DateTime, 0) ZEND_ARG_OBJ_INFO(0, object, DateTimeImmutable, 0) ZEND_END_ARG_INFO() @@ -262,21 +265,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_createFromInterfac ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_createFromFormat, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTime_createFromFormat, 0, 2, DateTime, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, timezone, DateTimeZone, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_DateTime_getLastErrors arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DateTime_getLastErrors, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() #define arginfo_class_DateTime_format arginfo_class_DateTimeInterface_format -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_modify, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTime_modify, 0, 1, DateTime, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, modifier, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_add, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_add, 0, 1, DateTime, 0) ZEND_ARG_OBJ_INFO(0, interval, DateInterval, 0) ZEND_END_ARG_INFO() @@ -284,76 +288,106 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateTime_getTimezone arginfo_class_DateTimeInterface_getTimezone -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setTimezone, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_setTimezone, 0, 1, DateTime, 0) ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 0) ZEND_END_ARG_INFO() -#define arginfo_class_DateTime_getOffset arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTime_getOffset arginfo_class_DateTimeInterface_getOffset -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setTime, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_setTime, 0, 2, DateTime, 0) ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, second, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microsecond, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setDate, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_setDate, 0, 3, DateTime, 0) ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, day, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setISODate, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_setISODate, 0, 2, DateTime, 0) ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, week, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dayOfWeek, IS_LONG, 0, "1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setTimestamp, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_setTimestamp, 0, 1, DateTime, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_DateTime_getTimestamp arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTime_getTimestamp arginfo_class_DateTimeInterface_getOffset -#define arginfo_class_DateTime_diff arginfo_class_DateTimeInterface_diff +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_diff, 0, 1, DateInterval, 0) + ZEND_ARG_OBJ_INFO(0, targetObject, DateTimeInterface, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, absolute, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable___construct arginfo_class_DateTime___construct -#define arginfo_class_DateTimeImmutable___wakeup arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeImmutable___wakeup arginfo_class_DateTimeInterface___wakeup -#define arginfo_class_DateTimeImmutable___set_state arginfo_class_DateTime___set_state +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable___set_state, 0, 1, DateTimeImmutable, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_createFromFormat arginfo_class_DateTime_createFromFormat +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTimeImmutable_createFromFormat, 0, 2, DateTimeImmutable, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) + ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, timezone, DateTimeZone, 1, "null") +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_getLastErrors arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeImmutable_getLastErrors arginfo_class_DateTime_getLastErrors #define arginfo_class_DateTimeImmutable_format arginfo_class_DateTimeInterface_format #define arginfo_class_DateTimeImmutable_getTimezone arginfo_class_DateTimeInterface_getTimezone -#define arginfo_class_DateTimeImmutable_getOffset arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeImmutable_getOffset arginfo_class_DateTimeInterface_getOffset -#define arginfo_class_DateTimeImmutable_getTimestamp arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeImmutable_getTimestamp arginfo_class_DateTimeInterface_getOffset -#define arginfo_class_DateTimeImmutable_diff arginfo_class_DateTimeInterface_diff +#define arginfo_class_DateTimeImmutable_diff arginfo_class_DateTime_diff -#define arginfo_class_DateTimeImmutable_modify arginfo_class_DateTime_modify +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateTimeImmutable_modify, 0, 1, DateTimeImmutable, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, modifier, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_add arginfo_class_DateTime_add +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_add, 0, 1, DateTimeImmutable, 0) + ZEND_ARG_OBJ_INFO(0, interval, DateInterval, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_sub arginfo_class_DateTime_add +#define arginfo_class_DateTimeImmutable_sub arginfo_class_DateTimeImmutable_add -#define arginfo_class_DateTimeImmutable_setTimezone arginfo_class_DateTime_setTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTimezone, 0, 1, DateTimeImmutable, 0) + ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_setTime arginfo_class_DateTime_setTime +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTime, 0, 2, DateTimeImmutable, 0) + ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, second, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microsecond, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_setDate arginfo_class_DateTime_setDate +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setDate, 0, 3, DateTimeImmutable, 0) + ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, day, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_setISODate arginfo_class_DateTime_setISODate +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setISODate, 0, 2, DateTimeImmutable, 0) + ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, week, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dayOfWeek, IS_LONG, 0, "1") +ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeImmutable_setTimestamp arginfo_class_DateTime_setTimestamp +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTimestamp, 0, 1, DateTimeImmutable, 0) + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_createFromMutable, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_createFromMutable, 0, 1, DateTimeImmutable, 0) ZEND_ARG_OBJ_INFO(0, object, DateTime, 0) ZEND_END_ARG_INFO() @@ -365,43 +399,49 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, timezone, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeZone_getName arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeZone_getName, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getOffset, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeZone_getOffset, 0, 1, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getTransitions, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_DateTimeZone_getTransitions, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timestampBegin, IS_LONG, 0, "PHP_INT_MIN") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timestampEnd, IS_LONG, 0, "PHP_INT_MAX") ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeZone_getLocation arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeZone_getLocation arginfo_class_DateTime_getLastErrors -#define arginfo_class_DateTimeZone_listAbbreviations arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeZone_listAbbreviations, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_listIdentifiers, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeZone_listIdentifiers, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timezoneGroup, IS_LONG, 0, "DateTimeZone::ALL") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, countryCode, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_DateTimeZone___wakeup arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateTimeZone___wakeup arginfo_class_DateTimeInterface___wakeup -#define arginfo_class_DateTimeZone___set_state arginfo_class_DateTime___set_state +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeZone___set_state, 0, 1, DateTimeZone, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateInterval___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, duration, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateInterval_createFromDateString, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_DateInterval_createFromDateString, 0, 1, DateInterval, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_DateInterval_format arginfo_class_DateTimeInterface_format -#define arginfo_class_DateInterval___wakeup arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DateInterval___wakeup arginfo_class_DateTimeInterface___wakeup -#define arginfo_class_DateInterval___set_state arginfo_class_DateTime___set_state +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateInterval___set_state, 0, 1, DateInterval, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DatePeriod___construct, 0, 0, 1) ZEND_ARG_INFO(0, start) @@ -410,17 +450,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DatePeriod___construct, 0, 0, 1) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -#define arginfo_class_DatePeriod_getStartDate arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod_getStartDate, 0, 0, DateTimeInterface, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DatePeriod_getEndDate arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod_getEndDate, 0, 0, DateTimeInterface, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_DatePeriod_getDateInterval arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod_getDateInterval, 0, 0, DateInterval, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_DatePeriod_getRecurrences arginfo_class_DateTimeInterface_getTimezone +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DatePeriod_getRecurrences, 0, 0, IS_LONG, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_DatePeriod___wakeup arginfo_class_DateTimeInterface_getTimezone +#define arginfo_class_DatePeriod___wakeup arginfo_class_DateTimeInterface___wakeup -#define arginfo_class_DatePeriod___set_state arginfo_class_DateTime___set_state +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod___set_state, 0, 1, DatePeriod, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod_getIterator, 0, 0, Iterator, 0) ZEND_END_ARG_INFO() diff --git a/ext/date/tests/DateTime_extends_basic3.phpt b/ext/date/tests/DateTime_extends_basic3.phpt index 27fc602e00506..a1e72cf1f2c32 100644 --- a/ext/date/tests/DateTime_extends_basic3.phpt +++ b/ext/date/tests/DateTime_extends_basic3.phpt @@ -9,7 +9,7 @@ echo "*** Testing new DateTime() : with user format() method ***\n"; class DateTimeExt extends DateTime { - public function format($format = "F j, Y, g:i:s a") + public function format($format = "F j, Y, g:i:s a"): string { return parent::format($format); } diff --git a/ext/date/tests/bug55407.phpt b/ext/date/tests/bug55407.phpt index c4638c94b3352..f478a52129826 100644 --- a/ext/date/tests/bug55407.phpt +++ b/ext/date/tests/bug55407.phpt @@ -6,7 +6,7 @@ error_reporting=-1 = 56 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Normalizer_getRawDecomposition, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Normalizer_getRawDecomposition, 0, 1, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, form, IS_LONG, 0, "Normalizer::FORM_C") ZEND_END_ARG_INFO() diff --git a/ext/intl/resourcebundle/resourcebundle_arginfo.h b/ext/intl/resourcebundle/resourcebundle_arginfo.h index 99468a299aabc..82d1e9bf652df 100644 --- a/ext/intl/resourcebundle/resourcebundle_arginfo.h +++ b/ext/intl/resourcebundle/resourcebundle_arginfo.h @@ -7,23 +7,28 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -#define arginfo_class_ResourceBundle_create arginfo_class_ResourceBundle___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ResourceBundle_create, 0, 2, ResourceBundle, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, bundle, IS_STRING, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true") +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_get, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ResourceBundle_get, 0, 1, IS_MIXED, 0) ZEND_ARG_INFO(0, index) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_count, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ResourceBundle_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_getLocales, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ResourceBundle_getLocales, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, bundle, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_ResourceBundle_getErrorCode arginfo_class_ResourceBundle_count -#define arginfo_class_ResourceBundle_getErrorMessage arginfo_class_ResourceBundle_count +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ResourceBundle_getErrorMessage, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ResourceBundle_getIterator, 0, 0, Iterator, 0) ZEND_END_ARG_INFO() diff --git a/ext/intl/spoofchecker/spoofchecker_arginfo.h b/ext/intl/spoofchecker/spoofchecker_arginfo.h index e3d81bf37ae51..1709ced249cee 100644 --- a/ext/intl/spoofchecker/spoofchecker_arginfo.h +++ b/ext/intl/spoofchecker/spoofchecker_arginfo.h @@ -4,27 +4,27 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_isSuspicious, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Spoofchecker_isSuspicious, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errorCode, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_areConfusable, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Spoofchecker_areConfusable, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errorCode, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setAllowedLocales, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Spoofchecker_setAllowedLocales, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, locales, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setChecks, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Spoofchecker_setChecks, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, checks, IS_LONG, 0) ZEND_END_ARG_INFO() #if U_ICU_VERSION_MAJOR_NUM >= 58 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setRestrictionLevel, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Spoofchecker_setRestrictionLevel, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/intl/tests/uconverter_oop_callback.phpt b/ext/intl/tests/uconverter_oop_callback.phpt index c6e34fc27d3ea..a765eadde1aa7 100644 --- a/ext/intl/tests/uconverter_oop_callback.phpt +++ b/ext/intl/tests/uconverter_oop_callback.phpt @@ -9,7 +9,7 @@ class MyConverter extends UConverter { /** * Called during conversion from source encoding to internal UChar representation */ - public function toUCallback($reason, $source, $codeUnits, &$error) { + public function toUCallback($reason, $source, $codeUnits, &$error): string|int|array|null { echo "toUCallback(", UConverter::reasonText($reason), ", ...)\n"; return parent::toUCallback($reason, $source, $codeUnits, $error); } @@ -17,7 +17,7 @@ class MyConverter extends UConverter { /** * Called during conversion from internal UChar to destination encoding */ - public function fromUCallback($reason, $source, $codePoint, &$error) { + public function fromUCallback($reason, $source, $codePoint, &$error): string|int|array|null { echo "fromUCallback(", UConverter::reasonText($reason), ", ...)\n"; return parent::fromUCallback($reason, $source, $codePoint, $error); } diff --git a/ext/intl/tests/uconverter_oop_callback2.phpt b/ext/intl/tests/uconverter_oop_callback2.phpt index e9123fc0064fe..0bbca94be80a0 100644 --- a/ext/intl/tests/uconverter_oop_callback2.phpt +++ b/ext/intl/tests/uconverter_oop_callback2.phpt @@ -9,7 +9,7 @@ class MyConverter extends UConverter { /** * Called during conversion from source encoding to internal UChar representation */ - public function toUCallback($reason, $source, $codeUnits, &$error) { + public function toUCallback($reason, $source, $codeUnits, &$error): string|int|array|null { echo "toUCallback(", UConverter::reasonText($reason), ", ...)\n"; return parent::toUCallback($reason, $source, $codeUnits, $error); } @@ -17,7 +17,7 @@ class MyConverter extends UConverter { /** * Called during conversion from internal UChar to destination encoding */ - public function fromUCallback($reason, $source, $codePoint, &$error) { + public function fromUCallback($reason, $source, $codePoint, &$error): string|int|array|null { echo "fromUCallback(", UConverter::reasonText($reason), ", ...)\n"; return parent::fromUCallback($reason, $source, $codePoint, $error); } diff --git a/ext/intl/tests/uconverter_oop_callback_return.phpt b/ext/intl/tests/uconverter_oop_callback_return.phpt index f6fa22ba87c5b..2cba357e7d927 100644 --- a/ext/intl/tests/uconverter_oop_callback_return.phpt +++ b/ext/intl/tests/uconverter_oop_callback_return.phpt @@ -5,7 +5,7 @@ UConverter::convert() w/ Callback Return Values --FILE-- = 52 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone_getWindowsID, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlTimeZone_getWindowsID, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, timezoneId, IS_STRING, 0) ZEND_END_ARG_INFO() #endif #if U_ICU_VERSION_MAJOR_NUM >= 52 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone_getIDForWindowsID, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlTimeZone_getIDForWindowsID, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, timezoneId, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, region, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone_hasSameRules, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlTimeZone_hasSameRules, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, other, IntlTimeZone, 0) ZEND_END_ARG_INFO() -#define arginfo_class_IntlTimeZone_toDateTimeZone arginfo_class_IntlTimeZone___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_IntlTimeZone_toDateTimeZone, 0, 0, DateTimeZone, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_IntlTimeZone_useDaylightTime arginfo_class_IntlTimeZone___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlTimeZone_useDaylightTime, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() ZEND_METHOD(IntlTimeZone, __construct); diff --git a/ext/intl/transliterator/transliterator_arginfo.h b/ext/intl/transliterator/transliterator_arginfo.h index 94318cb3b7ab4..fd95368fbba2f 100644 --- a/ext/intl/transliterator/transliterator_arginfo.h +++ b/ext/intl/transliterator/transliterator_arginfo.h @@ -4,29 +4,33 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Transliterator___construct, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Transliterator_create, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Transliterator_create, 0, 1, Transliterator, 1) ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, direction, IS_LONG, 0, "Transliterator::FORWARD") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Transliterator_createFromRules, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Transliterator_createFromRules, 0, 1, Transliterator, 1) ZEND_ARG_TYPE_INFO(0, rules, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, direction, IS_LONG, 0, "Transliterator::FORWARD") ZEND_END_ARG_INFO() -#define arginfo_class_Transliterator_createInverse arginfo_class_Transliterator___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Transliterator_createInverse, 0, 0, Transliterator, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_Transliterator_listIDs arginfo_class_Transliterator___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Transliterator_listIDs, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Transliterator_transliterate, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Transliterator_transliterate, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, end, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() -#define arginfo_class_Transliterator_getErrorCode arginfo_class_Transliterator___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Transliterator_getErrorCode, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_Transliterator_getErrorMessage arginfo_class_Transliterator___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Transliterator_getErrorMessage, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() ZEND_METHOD(Transliterator, __construct); diff --git a/ext/intl/uchar/uchar_arginfo.h b/ext/intl/uchar/uchar_arginfo.h index 680e336bfbbdd..d987792ca66e5 100644 --- a/ext/intl/uchar/uchar_arginfo.h +++ b/ext/intl/uchar/uchar_arginfo.h @@ -1,171 +1,186 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 65836ce6bd16316bb022bc75ce5e2fbbdd1880b7 */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 2, _IS_BOOL, 1) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_charAge, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_charAge, 0, 1, IS_ARRAY, 1) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_charDigitValue arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_charDigitValue, 0, 1, IS_LONG, 1) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_charDirection arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_charDirection arginfo_class_IntlChar_charDigitValue -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_charFromName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_charFromName, 0, 1, IS_LONG, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "IntlChar::UNICODE_CHAR_NAME") ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_charMirror arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_charMirror, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_charName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_charName, 0, 1, IS_STRING, 1) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "IntlChar::UNICODE_CHAR_NAME") ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_charType arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_charType arginfo_class_IntlChar_charDigitValue -#define arginfo_class_IntlChar_chr arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_chr, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_digit, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_digit, 0, 1, MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_NULL) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "10") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_enumCharNames, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_enumCharNames, 0, 3, _IS_BOOL, 1) ZEND_ARG_TYPE_MASK(0, start, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, end, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "IntlChar::UNICODE_CHAR_NAME") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_enumCharTypes, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_enumCharTypes, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_foldCase, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_foldCase, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "IntlChar::FOLD_CASE_DEFAULT") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_forDigit, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_forDigit, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, digit, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "10") ZEND_END_ARG_INFO() #if U_ICU_VERSION_MAJOR_NUM >= 52 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getBidiPairedBracket, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_getBidiPairedBracket, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #endif -#define arginfo_class_IntlChar_getBlockCode arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_getBlockCode arginfo_class_IntlChar_charDigitValue -#define arginfo_class_IntlChar_getCombiningClass arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_getCombiningClass arginfo_class_IntlChar_charDigitValue -#define arginfo_class_IntlChar_getFC_NFKC_Closure arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_getFC_NFKC_Closure, 0, 1, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getIntPropertyMaxValue, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getIntPropertyMaxValue, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_IntlChar_getIntPropertyMinValue arginfo_class_IntlChar_getIntPropertyMaxValue -#define arginfo_class_IntlChar_getIntPropertyValue arginfo_class_IntlChar_hasBinaryProperty +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getIntPropertyValue, 0, 2, IS_LONG, 1) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_getNumericValue arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getNumericValue, 0, 1, IS_DOUBLE, 1) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getPropertyEnum, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getPropertyEnum, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getPropertyName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_getPropertyName, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "IntlChar::LONG_PROPERTY_NAME") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getPropertyValueEnum, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getPropertyValueEnum, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getPropertyValueName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_IntlChar_getPropertyValueName, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "IntlChar::LONG_PROPERTY_NAME") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_getUnicodeVersion, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_getUnicodeVersion, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_isalnum arginfo_class_IntlChar_charAge +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_isalnum, 0, 1, _IS_BOOL, 1) + ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_isalpha arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isalpha arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isbase arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isbase arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isblank arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isblank arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_iscntrl arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_iscntrl arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isdefined arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isdefined arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isdigit arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isdigit arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isgraph arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isgraph arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isIDIgnorable arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isIDIgnorable arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isIDPart arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isIDPart arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isIDStart arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isIDStart arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isISOControl arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isISOControl arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isJavaIDPart arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isJavaIDPart arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isJavaIDStart arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isJavaIDStart arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isJavaSpaceChar arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isJavaSpaceChar arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_islower arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_islower arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isMirrored arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isMirrored arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isprint arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isprint arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_ispunct arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_ispunct arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isspace arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isspace arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_istitle arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_istitle arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isUAlphabetic arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isUAlphabetic arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isULowercase arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isULowercase arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isupper arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isupper arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isUUppercase arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isUUppercase arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isUWhiteSpace arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isUWhiteSpace arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isWhitespace arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isWhitespace arginfo_class_IntlChar_isalnum -#define arginfo_class_IntlChar_isxdigit arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_isxdigit arginfo_class_IntlChar_isalnum -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_ord, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_IntlChar_ord, 0, 1, IS_LONG, 1) ZEND_ARG_TYPE_MASK(0, character, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() -#define arginfo_class_IntlChar_tolower arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_tolower arginfo_class_IntlChar_charMirror -#define arginfo_class_IntlChar_totitle arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_totitle arginfo_class_IntlChar_charMirror -#define arginfo_class_IntlChar_toupper arginfo_class_IntlChar_charAge +#define arginfo_class_IntlChar_toupper arginfo_class_IntlChar_charMirror ZEND_METHOD(IntlChar, hasBinaryProperty); diff --git a/ext/json/json_arginfo.h b/ext/json/json_arginfo.h index ee8954c3ed379..ebb466f7f6889 100644 --- a/ext/json/json_arginfo.h +++ b/ext/json/json_arginfo.h @@ -20,7 +20,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_last_error_msg, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_JsonSerializable_jsonSerialize, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_JsonSerializable_jsonSerialize, 0, 0, IS_MIXED, 0) ZEND_END_ARG_INFO() diff --git a/ext/json/tests/bug61978.phpt b/ext/json/tests/bug61978.phpt index 8853bdbbd280f..283432f8773b6 100644 --- a/ext/json/tests/bug61978.phpt +++ b/ext/json/tests/bug61978.phpt @@ -17,7 +17,7 @@ class JsonTest2 implements JsonSerializable { public function __construct() { $this->test = '123'; } - public function jsonSerialize() { + public function jsonSerialize(): mixed { return array( 'test' => $this->test, 'me' => $this diff --git a/ext/json/tests/bug66025.phpt b/ext/json/tests/bug66025.phpt index 8f12fa40ca0fa..628adefc65115 100644 --- a/ext/json/tests/bug66025.phpt +++ b/ext/json/tests/bug66025.phpt @@ -4,7 +4,7 @@ Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function) json_decode('', true)]; } diff --git a/ext/json/tests/bug73113.phpt b/ext/json/tests/bug73113.phpt index 36d78ffdd4d11..d22b0c23f71b5 100644 --- a/ext/json/tests/bug73113.phpt +++ b/ext/json/tests/bug73113.phpt @@ -6,7 +6,7 @@ Also test that the custom exception is not wrapped by ext/json class JsonSerializableObject implements \JsonSerializable { - public function jsonSerialize() + public function jsonSerialize(): mixed { throw new \Exception('This error is expected'); } diff --git a/ext/json/tests/bug77843.phpt b/ext/json/tests/bug77843.phpt index c525285bf5abd..2709612659c61 100644 --- a/ext/json/tests/bug77843.phpt +++ b/ext/json/tests/bug77843.phpt @@ -5,7 +5,7 @@ Bug #77843: Use after free with json serializer class X implements JsonSerializable { public $prop = "value"; - public function jsonSerialize() { + public function jsonSerialize(): mixed { global $arr; unset($arr[0]); var_dump($this); diff --git a/ext/json/tests/serialize.phpt b/ext/json/tests/serialize.phpt index 288e3f6733763..31b36221ef9e6 100644 --- a/ext/json/tests/serialize.phpt +++ b/ext/json/tests/serialize.phpt @@ -17,7 +17,7 @@ class NonSerializingTest class SerializingTest extends NonSerializingTest implements JsonSerializable { - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->data; } @@ -25,7 +25,7 @@ class SerializingTest extends NonSerializingTest implements JsonSerializable class ValueSerializingTest extends SerializingTest { - public function jsonSerialize() + public function jsonSerialize(): mixed { return array_values(is_array($this->data) ? $this->data : get_object_vars($this->data)); } @@ -33,7 +33,7 @@ class ValueSerializingTest extends SerializingTest class SelfSerializingTest extends SerializingTest { - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this; } diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 56ee06aa6daa0..a0a0e8846a7ce 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -431,67 +431,79 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, socket, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_autocommit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_change_user, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_change_user, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_character_set_name, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_character_set_name, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_close arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_close, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() #define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction -#define arginfo_class_mysqli_connect arginfo_class_mysqli___construct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_connect, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hostname, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, socket, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_dump_debug_info arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_dump_debug_info arginfo_class_mysqli_close -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_debug, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_debug, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_get_charset arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_get_charset, 0, 0, IS_OBJECT, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_get_client_info arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_get_client_info, 0, 0, IS_STRING, 1) +ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_get_connection_stats, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_get_connection_stats, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() #endif #define arginfo_class_mysqli_get_server_info arginfo_class_mysqli_character_set_name -#define arginfo_class_mysqli_get_warnings arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_get_warnings, 0, 0, mysqli_warning, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_init arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_init, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_kill, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_multi_query, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_more_results arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_more_results arginfo_class_mysqli_close -#define arginfo_class_mysqli_next_result arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_next_result arginfo_class_mysqli_close -#define arginfo_class_mysqli_ping arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_ping arginfo_class_mysqli_close #if defined(MYSQLI_USE_MYSQLND) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_poll, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, reject, IS_ARRAY, 0) @@ -500,14 +512,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4) ZEND_END_ARG_INFO() #endif -#define arginfo_class_mysqli_prepare arginfo_class_mysqli_multi_query +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_prepare, 0, 1, mysqli_stmt, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_query, 0, 1, mysqli_result, MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_mode, IS_LONG, 0, "MYSQLI_STORE_RESULT") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hostname, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") @@ -517,19 +531,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) -#define arginfo_class_mysqli_reap_async_query arginfo_class_mysqli_get_connection_stats +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_reap_async_query, 0, 0, mysqli_result, MAY_BE_BOOL) +ZEND_END_ARG_INFO() #endif #define arginfo_class_mysqli_escape_string arginfo_class_mysqli_real_escape_string #define arginfo_class_mysqli_real_query arginfo_class_mysqli_multi_query -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -537,22 +552,22 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_savepoint arginfo_class_mysqli_release_savepoint -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_select_db, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_select_db, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_set_charset, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_set_charset, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_options, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_options, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() #define arginfo_class_mysqli_set_opt arginfo_class_mysqli_options -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 5, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, certificate, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, ca_certificate, IS_STRING, 1) @@ -560,19 +575,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5) ZEND_ARG_TYPE_INFO(0, cipher_algos, IS_STRING, 1) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stat arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_stat, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stmt_init arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_stmt_init, 0, 0, mysqli_stmt, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_store_result, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_store_result, 0, 0, mysqli_result, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_thread_safe arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_thread_safe arginfo_class_mysqli_close -#define arginfo_class_mysqli_use_result arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_use_result, 0, 0, mysqli_result, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_refresh, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_refresh, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -581,46 +599,52 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_mode, IS_LONG, 0, "MYSQLI_STORE_RESULT") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_close arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_result_close, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_free arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_result_free arginfo_class_mysqli_result_close -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_data_seek, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_result_data_seek, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_fetch_field arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_field, 0, 0, MAY_BE_OBJECT|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_fetch_fields arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_result_fetch_fields, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_field_direct, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_field_direct, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_all, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_result_fetch_all, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_NUM") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_array, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_array, 0, 0, MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_BOTH") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_fetch_assoc arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_assoc, 0, 0, MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 0, "\"stdClass\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructor_args, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_fetch_row arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_result_fetch_row arginfo_class_mysqli_result_fetch_assoc ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_result_fetch_column, 0, 0, MAY_BE_NULL|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_field_seek arginfo_class_mysqli_result_fetch_field_direct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_result_field_seek, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_result_free_result arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_result_free_result arginfo_class_mysqli_result_close ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_mysqli_result_getIterator, 0, 0, Iterator, 0) ZEND_END_ARG_INFO() @@ -630,64 +654,71 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, query, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, types, IS_STRING, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, _IS_BOOL, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_close -#define arginfo_class_mysqli_stmt_data_seek arginfo_class_mysqli_result_data_seek +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_data_seek, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_execute, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_execute, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stmt_fetch arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_fetch, 0, 0, _IS_BOOL, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stmt_get_warnings arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_get_warnings arginfo_class_mysqli_get_warnings -#define arginfo_class_mysqli_stmt_result_metadata arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_result_metadata arginfo_class_mysqli_use_result #if defined(MYSQLI_USE_MYSQLND) -#define arginfo_class_mysqli_stmt_more_results arginfo_class_mysqli_get_connection_stats +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_more_results, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() #endif -#define arginfo_class_mysqli_stmt_next_result arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_next_result arginfo_class_mysqli_close -#define arginfo_class_mysqli_stmt_num_rows arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_mysqli_stmt_num_rows, 0, 0, MAY_BE_LONG|MAY_BE_STRING) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, param_num, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_mysqli_stmt_free_result arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_free_result arginfo_class_mysqli_result_close -#define arginfo_class_mysqli_stmt_reset arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_reset arginfo_class_mysqli_close #define arginfo_class_mysqli_stmt_prepare arginfo_class_mysqli_multi_query -#define arginfo_class_mysqli_stmt_store_result arginfo_class_mysqli_character_set_name +#define arginfo_class_mysqli_stmt_store_result arginfo_class_mysqli_close #if defined(MYSQLI_USE_MYSQLND) -#define arginfo_class_mysqli_stmt_get_result arginfo_class_mysqli_get_connection_stats +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_stmt_get_result, 0, 0, mysqli_result, MAY_BE_FALSE) +ZEND_END_ARG_INFO() #endif -#define arginfo_class_mysqli_warning___construct arginfo_class_mysqli_character_set_name +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_warning___construct, 0, 0, 0) +ZEND_END_ARG_INFO() #define arginfo_class_mysqli_warning_next arginfo_mysqli_thread_safe diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 4fc33e377cc68..cde29de261194 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -438,51 +438,53 @@ ZEND_END_ARG_INFO() #define arginfo_oci_unregister_taf_callback arginfo_oci_rollback -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_save, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_save, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_import, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_import, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_OCILob_savefile arginfo_class_OCILob_import -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_load, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_load, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_read, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_read, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_eof arginfo_class_OCILob_load +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_eof, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_tell arginfo_class_OCILob_load +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_tell, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_rewind arginfo_class_OCILob_load +#define arginfo_class_OCILob_rewind arginfo_class_OCILob_eof -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_seek, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_seek, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "OCI_SEEK_SET") ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_size arginfo_class_OCILob_load +#define arginfo_class_OCILob_size arginfo_class_OCILob_tell -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_write, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_write, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_append, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_append, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, from, OCILob, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_truncate, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_truncate, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_erase, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCILob_erase, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() @@ -491,13 +493,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_flush, 0, 0, _IS_BO ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_setbuffering, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_setbuffering, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_getbuffering arginfo_class_OCILob_load +#define arginfo_class_OCILob_getbuffering arginfo_class_OCILob_eof -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_writetofile, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_writetofile, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") @@ -505,39 +507,39 @@ ZEND_END_ARG_INFO() #define arginfo_class_OCILob_export arginfo_class_OCILob_writetofile -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCILob_writetemporary, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCILob_writetemporary, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_TEMP_CLOB") ZEND_END_ARG_INFO() -#define arginfo_class_OCILob_close arginfo_class_OCILob_load +#define arginfo_class_OCILob_close arginfo_class_OCILob_eof -#define arginfo_class_OCILob_free arginfo_class_OCILob_load +#define arginfo_class_OCILob_free arginfo_class_OCILob_eof -#define arginfo_class_OCICollection_free arginfo_class_OCILob_load +#define arginfo_class_OCICollection_free arginfo_class_OCILob_eof -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCICollection_append, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_append, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCICollection_getElem, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_OCICollection_getElem, 0, 1, MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCICollection_assign, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_assign, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, from, OCICollection, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCICollection_assignelem, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_assignelem, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_OCICollection_size arginfo_class_OCILob_load +#define arginfo_class_OCICollection_size arginfo_class_OCILob_tell -#define arginfo_class_OCICollection_max arginfo_class_OCILob_load +#define arginfo_class_OCICollection_max arginfo_class_OCILob_tell -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCICollection_trim, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_OCICollection_trim, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 18f5713d9334c..a46c6d991743c 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -591,7 +591,7 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int if (Z_FUNC(p->val)->common.function_name) { Z_FUNC(p->val)->common.function_name = new_interned_string(Z_FUNC(p->val)->common.function_name); } - if (Z_FUNC(p->val)->common.arg_info && + if ((Z_FUNC(p->val)->common.arg_info) && (Z_FUNC(p->val)->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS))) { uint32_t i; uint32_t num_args = Z_FUNC(p->val)->common.num_args + 1; @@ -3885,7 +3885,9 @@ static bool preload_needed_types_known(zend_class_entry *ce) { zend_string *lcname; ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, lcname, fptr) { uint32_t i; - if (fptr->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if ((fptr->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && + !ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1]) + ) { if (!preload_is_type_known(ce, &fptr->common.arg_info[-1].type) && preload_is_method_maybe_override(ce, lcname)) { return 0; diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 74bc138767bd9..a6d4b5a57e8f5 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3604,7 +3604,9 @@ static int zend_real_jit_func(zend_op_array *op_array, zend_script *script, cons } func_info = ZEND_FUNC_INFO(op_array); func_info->call_map = zend_build_call_map(&CG(arena), func_info, op_array); - if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if ((op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && + !ZEND_ARG_TYPE_IS_TENTATIVE(&((zend_function *) op_array)->common.arg_info[-1]) + ) { zend_init_func_return_info(op_array, script, &func_info->return_info); } } @@ -3920,7 +3922,9 @@ ZEND_EXT_API int zend_jit_script(zend_script *script) info = ZEND_FUNC_INFO(call_graph.op_arrays[i]); if (info) { info->call_map = zend_build_call_map(&CG(arena), info, call_graph.op_arrays[i]); - if (call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if ((call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && + !ZEND_ARG_TYPE_IS_TENTATIVE(&((zend_function *) call_graph.op_arrays[i])->common.arg_info[-1]) + ) { zend_init_func_return_info(call_graph.op_arrays[i], script, &info->return_info); } } diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 66f6cd30c01ce..a9b6180c57ade 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -489,7 +489,9 @@ static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_sc break; } jit_extension->func_info.call_map = zend_build_call_map(&CG(arena), &jit_extension->func_info, op_array); - if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE && + !ZEND_ARG_TYPE_IS_TENTATIVE(&((zend_function *) op_array)->common.arg_info[-1]) + ) { zend_init_func_return_info(op_array, script, &jit_extension->func_info.return_info); } } diff --git a/ext/opcache/tests/bug64353.phpt b/ext/opcache/tests/bug64353.phpt index bef3846d73395..22d768938f7b3 100644 --- a/ext/opcache/tests/bug64353.phpt +++ b/ext/opcache/tests/bug64353.phpt @@ -9,7 +9,7 @@ opcache --FILE-- isProtected(); $this->isPrivate(); print $str ."\n"; + + return $str; } } diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt index ee38f98cac1c5..98948fcac6591 100644 --- a/ext/pdo/tests/pdo_023.phpt +++ b/ext/pdo/tests/pdo_023.phpt @@ -47,7 +47,7 @@ class PDODatabaseX extends PDO $this->test2 = 22; } - function query($sql, ...$rest) + function query($sql, ...$rest): PDOStatement|false { echo __METHOD__ . "()\n"; $stmt = parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx'))); diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt index 23d599e847d75..a169926a307b0 100644 --- a/ext/pdo/tests/pdo_026.phpt +++ b/ext/pdo/tests/pdo_026.phpt @@ -42,7 +42,7 @@ class PDODatabase extends PDO echo __METHOD__ . "()\n"; } - function query($sql, ...$rest) + function query($sql, ...$rest): PDOStatement|false { echo __METHOD__ . "()\n"; $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); diff --git a/ext/pdo/tests/pdo_029.phpt b/ext/pdo/tests/pdo_029.phpt index 4eaf922bfd915..b79cd7ec49e84 100644 --- a/ext/pdo/tests/pdo_029.phpt +++ b/ext/pdo/tests/pdo_029.phpt @@ -34,10 +34,10 @@ class PDOStatementX extends PDOStatement echo __METHOD__ . "()\n"; } - function execute($params = array()) + function execute($params = array()): bool { echo __METHOD__ . "()\n"; - parent::execute(); + return parent::execute(); } } @@ -48,7 +48,7 @@ class PDODatabase extends PDO echo __METHOD__ . "()\n"; } - function query($sql, ...$rest) + function query($sql, ...$rest): PDOStatement|false { echo __METHOD__ . "()\n"; $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); diff --git a/ext/pdo/tests/pdo_030.phpt b/ext/pdo/tests/pdo_030.phpt index e21047d630011..c71d96171f76c 100644 --- a/ext/pdo/tests/pdo_030.phpt +++ b/ext/pdo/tests/pdo_030.phpt @@ -35,7 +35,7 @@ class PDOStatementX extends PDOStatement echo __METHOD__ . "()\n"; } - function execute($params = array()) + function execute($params = array()): bool { echo __METHOD__ . "()\n"; parent::execute(); @@ -49,7 +49,7 @@ class PDODatabase extends PDO echo __METHOD__ . "()\n"; } - function query($sql, ...$rest) + function query($sql, ...$rest): PDOStatement|false { echo __METHOD__ . "()\n"; return parent::query($sql); diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt index 4bbf63993970b..9ca2e3a6b0141 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt @@ -96,8 +96,8 @@ $db = MySQLPDOTest::factory(); $stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 2'); class mystatement5 extends mystatement4 { - public function fetchAll($fetch_style = 1, ...$fetch_args) { - return "no data :)"; + public function fetchAll($fetch_style = 1, ...$fetch_args): array { + return []; } } @@ -146,7 +146,8 @@ mystatement4 string(6) "param1" mystatement5 string(12) "mystatement5" -string(10) "no data :)" +array(0) { +} array(1) { [0]=> array(4) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt index d79de1486263c..8a2824f502050 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt @@ -19,12 +19,12 @@ MySQLPDOTest::skip(); return call_user_func_array(array($this, 'parent::__construct'), func_get_args()); } - public function exec($statement) { + public function exec($statement): int|false { $this->protocol(); return parent::exec($statement); } - public function query(...$args) { + public function query(...$args): PDOStatement|false { $this->protocol(); return parent::query(...$args); } diff --git a/ext/pdo_pgsql/pgsql_driver_arginfo.h b/ext/pdo_pgsql/pgsql_driver_arginfo.h index d8d33450af8f0..94348603394a4 100644 --- a/ext/pdo_pgsql/pgsql_driver_arginfo.h +++ b/ext/pdo_pgsql/pgsql_driver_arginfo.h @@ -1,7 +1,7 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 82be78f03c363afd795c59bcbb061ef0b2f9d08c */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, rows, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") @@ -9,7 +9,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromArray, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") @@ -17,7 +17,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyToArray, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlCopyToArray, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nullAs, IS_STRING, 0, "\"\\\\\\\\N\"") @@ -26,7 +26,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_PDO_PGSql_Ext_pgsqlCopyToFile arginfo_class_PDO_PGSql_Ext_pgsqlCopyFromFile -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBOpen, 0, 0, 1) @@ -34,16 +34,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBOpen, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"rb\"") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBUnlink, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlLOBUnlink, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, oid, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetNotify, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetNotify, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetchMode, IS_LONG, 0, "PDO::FETCH_USE_DEFAULT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeoutMilliseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#define arginfo_class_PDO_PGSql_Ext_pgsqlGetPid arginfo_class_PDO_PGSql_Ext_pgsqlLOBCreate +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_PGSql_Ext_pgsqlGetPid, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() ZEND_METHOD(PDO_PGSql_Ext, pgsqlCopyFromArray); diff --git a/ext/pdo_sqlite/sqlite_driver_arginfo.h b/ext/pdo_sqlite/sqlite_driver_arginfo.h index 370f3d1315940..787d592175da4 100644 --- a/ext/pdo_sqlite/sqlite_driver_arginfo.h +++ b/ext/pdo_sqlite/sqlite_driver_arginfo.h @@ -1,21 +1,21 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 49737f1a08f0b1b66e326b7d06e316105202d27d */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateFunction, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateFunction, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numArgs, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateAggregate, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateAggregate, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, step, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, finalize, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numArgs, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateCollation, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDO_SQLite_Ext_sqliteCreateCollation, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() diff --git a/ext/phar/phar_object_arginfo.h b/ext/phar/phar_object_arginfo.h index 4811e6a56758d..3bd96c709ca27 100644 --- a/ext/phar/phar_object_arginfo.h +++ b/ext/phar/phar_object_arginfo.h @@ -10,46 +10,47 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___destruct, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_addEmptyDir, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_addEmptyDir, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_addFile, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_addFile, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, localName, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_addFromString, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_addFromString, 0, 2, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, localName, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, contents, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_buildFromDirectory, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Phar_buildFromDirectory, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_buildFromIterator, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Phar_buildFromIterator, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, baseDirectory, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_compressFiles, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_compressFiles, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, compression, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_Phar_decompressFiles arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_decompressFiles, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_compress, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_compress, 0, 1, Phar, 1) ZEND_ARG_TYPE_INFO(0, compression, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_decompress, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_decompress, 0, 0, Phar, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_convertToExecutable, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_convertToExecutable, 0, 0, Phar, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") @@ -57,94 +58,101 @@ ZEND_END_ARG_INFO() #define arginfo_class_Phar_convertToData arginfo_class_Phar_convertToExecutable -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_copy, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_copy, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_count, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_count, 0, 0, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "COUNT_NORMAL") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_delete, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_delete, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, localName, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_Phar_delMetadata arginfo_class_Phar___destruct +#define arginfo_class_Phar_delMetadata arginfo_class_Phar_decompressFiles -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_extractTo, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_extractTo, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, files, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, overwrite, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -#define arginfo_class_Phar_getAlias arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_getAlias, 0, 0, IS_STRING, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_Phar_getPath arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_getPath, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_getMetadata, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_getMetadata, 0, 0, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, unserializeOptions, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#define arginfo_class_Phar_getModified arginfo_class_Phar___destruct +#define arginfo_class_Phar_getModified arginfo_class_Phar_decompressFiles -#define arginfo_class_Phar_getSignature arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Phar_getSignature, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_Phar_getStub arginfo_class_Phar___destruct +#define arginfo_class_Phar_getStub arginfo_class_Phar_getPath -#define arginfo_class_Phar_getVersion arginfo_class_Phar___destruct +#define arginfo_class_Phar_getVersion arginfo_class_Phar_getPath -#define arginfo_class_Phar_hasMetadata arginfo_class_Phar___destruct +#define arginfo_class_Phar_hasMetadata arginfo_class_Phar_decompressFiles -#define arginfo_class_Phar_isBuffering arginfo_class_Phar___destruct +#define arginfo_class_Phar_isBuffering arginfo_class_Phar_decompressFiles -#define arginfo_class_Phar_isCompressed arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Phar_isCompressed, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_isFileFormat, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_isFileFormat, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, format, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_Phar_isWritable arginfo_class_Phar___destruct +#define arginfo_class_Phar_isWritable arginfo_class_Phar_decompressFiles -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_offsetExists, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_offsetExists, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, localName) ZEND_END_ARG_INFO() -#define arginfo_class_Phar_offsetGet arginfo_class_Phar_offsetExists +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_offsetGet, 0, 1, PharFileInfo, 0) + ZEND_ARG_INFO(0, localName) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_offsetSet, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_offsetSet, 0, 2, IS_VOID, 0) ZEND_ARG_INFO(0, localName) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() #define arginfo_class_Phar_offsetUnset arginfo_class_Phar_offsetExists -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setAlias, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_setAlias, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setDefaultStub, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_setDefaultStub, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, index, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, webIndex, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setMetadata, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_setMetadata, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, metadata, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setSignatureAlgorithm, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_setSignatureAlgorithm, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, privateKey, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setStub, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_setStub, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, stub) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_Phar_startBuffering arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_startBuffering, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_Phar_stopBuffering arginfo_class_Phar___destruct +#define arginfo_class_Phar_stopBuffering arginfo_class_Phar_startBuffering ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_apiVersion, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -230,7 +238,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_PharData_compressFiles arginfo_class_Phar_compressFiles -#define arginfo_class_PharData_decompressFiles arginfo_class_Phar___destruct +#define arginfo_class_PharData_decompressFiles arginfo_class_Phar_decompressFiles #define arginfo_class_PharData_compress arginfo_class_Phar_compress @@ -246,37 +254,37 @@ ZEND_END_ARG_INFO() #define arginfo_class_PharData_delete arginfo_class_Phar_delete -#define arginfo_class_PharData_delMetadata arginfo_class_Phar___destruct +#define arginfo_class_PharData_delMetadata arginfo_class_Phar_decompressFiles #define arginfo_class_PharData_extractTo arginfo_class_Phar_extractTo -#define arginfo_class_PharData_getAlias arginfo_class_Phar___destruct +#define arginfo_class_PharData_getAlias arginfo_class_Phar_getAlias -#define arginfo_class_PharData_getPath arginfo_class_Phar___destruct +#define arginfo_class_PharData_getPath arginfo_class_Phar_getPath #define arginfo_class_PharData_getMetadata arginfo_class_Phar_getMetadata -#define arginfo_class_PharData_getModified arginfo_class_Phar___destruct +#define arginfo_class_PharData_getModified arginfo_class_Phar_decompressFiles -#define arginfo_class_PharData_getSignature arginfo_class_Phar___destruct +#define arginfo_class_PharData_getSignature arginfo_class_Phar_getSignature -#define arginfo_class_PharData_getStub arginfo_class_Phar___destruct +#define arginfo_class_PharData_getStub arginfo_class_Phar_getPath -#define arginfo_class_PharData_getVersion arginfo_class_Phar___destruct +#define arginfo_class_PharData_getVersion arginfo_class_Phar_getPath -#define arginfo_class_PharData_hasMetadata arginfo_class_Phar___destruct +#define arginfo_class_PharData_hasMetadata arginfo_class_Phar_decompressFiles -#define arginfo_class_PharData_isBuffering arginfo_class_Phar___destruct +#define arginfo_class_PharData_isBuffering arginfo_class_Phar_decompressFiles -#define arginfo_class_PharData_isCompressed arginfo_class_Phar___destruct +#define arginfo_class_PharData_isCompressed arginfo_class_Phar_isCompressed #define arginfo_class_PharData_isFileFormat arginfo_class_Phar_isFileFormat -#define arginfo_class_PharData_isWritable arginfo_class_Phar___destruct +#define arginfo_class_PharData_isWritable arginfo_class_Phar_decompressFiles #define arginfo_class_PharData_offsetExists arginfo_class_Phar_offsetExists -#define arginfo_class_PharData_offsetGet arginfo_class_Phar_offsetExists +#define arginfo_class_PharData_offsetGet arginfo_class_Phar_offsetGet #define arginfo_class_PharData_offsetSet arginfo_class_Phar_offsetSet @@ -292,9 +300,9 @@ ZEND_END_ARG_INFO() #define arginfo_class_PharData_setStub arginfo_class_Phar_setStub -#define arginfo_class_PharData_startBuffering arginfo_class_Phar___destruct +#define arginfo_class_PharData_startBuffering arginfo_class_Phar_startBuffering -#define arginfo_class_PharData_stopBuffering arginfo_class_Phar___destruct +#define arginfo_class_PharData_stopBuffering arginfo_class_Phar_startBuffering #define arginfo_class_PharData_apiVersion arginfo_class_Phar_apiVersion @@ -332,33 +340,36 @@ ZEND_END_ARG_INFO() #define arginfo_class_PharFileInfo___destruct arginfo_class_Phar___destruct -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_chmod, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PharFileInfo_chmod, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, perms, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_PharFileInfo_compress arginfo_class_Phar_compressFiles +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PharFileInfo_compress, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, compression, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_PharFileInfo_decompress arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_decompress arginfo_class_Phar_decompressFiles -#define arginfo_class_PharFileInfo_delMetadata arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_delMetadata arginfo_class_Phar_decompressFiles -#define arginfo_class_PharFileInfo_getCompressedSize arginfo_class_Phar___destruct +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PharFileInfo_getCompressedSize, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_PharFileInfo_getCRC32 arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_getCRC32 arginfo_class_PharFileInfo_getCompressedSize -#define arginfo_class_PharFileInfo_getContent arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_getContent arginfo_class_Phar_getPath #define arginfo_class_PharFileInfo_getMetadata arginfo_class_Phar_getMetadata -#define arginfo_class_PharFileInfo_getPharFlags arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_getPharFlags arginfo_class_PharFileInfo_getCompressedSize -#define arginfo_class_PharFileInfo_hasMetadata arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_hasMetadata arginfo_class_Phar_decompressFiles -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_isCompressed, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PharFileInfo_isCompressed, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression, IS_LONG, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_PharFileInfo_isCRCChecked arginfo_class_Phar___destruct +#define arginfo_class_PharFileInfo_isCRCChecked arginfo_class_Phar_decompressFiles #define arginfo_class_PharFileInfo_setMetadata arginfo_class_Phar_setMetadata diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4b05a4d0ac569..5828246dd9939 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -849,7 +849,7 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent } _function_parameter_string(str, fptr, ZSTR_VAL(param_indent.s)); smart_str_free(¶m_indent); - if (fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + if ((fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && !ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1])) { smart_str_append_printf(str, " %s- Return [ ", indent); if (ZEND_TYPE_IS_SET(fptr->common.arg_info[-1].type)) { zend_string *type_str = zend_type_to_string(fptr->common.arg_info[-1].type); @@ -3449,7 +3449,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, hasReturnType) GET_REFLECTION_OBJECT_PTR(fptr); - RETVAL_BOOL(fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE); + RETVAL_BOOL((fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && !ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1])); } /* }}} */ @@ -3465,7 +3465,43 @@ ZEND_METHOD(ReflectionFunctionAbstract, getReturnType) GET_REFLECTION_OBJECT_PTR(fptr); - if (!(fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) { + if (!(fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1])) { + RETURN_NULL(); + } + + reflection_type_factory(fptr->common.arg_info[-1].type, return_value, 1); +} +/* }}} */ + +/* {{{ Return whether the function has a return type */ +ZEND_METHOD(ReflectionFunctionAbstract, hasTentativeReturnType) +{ + reflection_object *intern; + zend_function *fptr; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + GET_REFLECTION_OBJECT_PTR(fptr); + + RETVAL_BOOL(fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1])); +} +/* }}} */ + +/* {{{ Returns the return type associated with the function */ +ZEND_METHOD(ReflectionFunctionAbstract, getTentativeReturnType) +{ + reflection_object *intern; + zend_function *fptr; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + GET_REFLECTION_OBJECT_PTR(fptr); + + if (!(fptr->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || !ZEND_ARG_TYPE_IS_TENTATIVE(&fptr->common.arg_info[-1])) { RETURN_NULL(); } diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 69384f88bb320..7bd22b6d839d9 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -98,6 +98,10 @@ public function hasReturnType() {} /** @return ReflectionType|null */ public function getReturnType() {} + public function hasTentativeReturnType(): bool {} + + public function getTentativeReturnType(): ?ReflectionType {} + /** @return ReflectionAttribute[] */ public function getAttributes(?string $name = null, int $flags = 0): array {} } diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index b1ea070d2ac3a..f1137ba4ab535 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,14 +1,14 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 47ac64b027cdeb0e9996147277f79fa9d6b876bd */ + * Stub hash: 0b2b52d4f891a594ccfcbcc0edeec97a9e0f80e6 */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract___clone, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunctionAbstract_inNamespace, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_inNamespace, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_class_ReflectionFunctionAbstract_isClosure arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -23,41 +23,56 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionFunctionAbstract_isVariadic arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionFunctionAbstract_getClosureThis arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getClosureThis, 0, 0, IS_OBJECT, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getClosureScopeClass arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getClosureScopeClass, 0, 0, ReflectionClass, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getDocComment arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionFunctionAbstract_getDocComment, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getEndLine arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionFunctionAbstract_getEndLine, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getExtension arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getExtension, 0, 0, ReflectionExtension, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getExtensionName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getExtensionName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionFunctionAbstract_getFileName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getFileName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionFunctionAbstract_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getName, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getNamespaceName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getNumberOfRequiredParameters arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getNumberOfRequiredParameters arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -#define arginfo_class_ReflectionFunctionAbstract_getParameters arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getParameters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getShortName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getShortName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionFunctionAbstract_getStartLine arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getStartLine arginfo_class_ReflectionFunctionAbstract_getEndLine -#define arginfo_class_ReflectionFunctionAbstract_getStaticVariables arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionFunctionAbstract_getStaticVariables arginfo_class_ReflectionFunctionAbstract_getParameters #define arginfo_class_ReflectionFunctionAbstract_returnsReference arginfo_class_ReflectionFunctionAbstract_inNamespace #define arginfo_class_ReflectionFunctionAbstract_hasReturnType arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionFunctionAbstract_getReturnType arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getReturnType, 0, 0, ReflectionType, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getTentativeReturnType, 0, 0, ReflectionType, 1) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getAttributes, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") @@ -73,33 +88,36 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionFunction_isDisabled arginfo_class_ReflectionFunctionAbstract_inNamespace -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_invoke, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunction_invoke, 0, 0, IS_MIXED, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_invokeArgs, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunction_invokeArgs, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunction_getClosure arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunction_getClosure, 0, 0, Closure, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionGenerator___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, generator, Generator, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionGenerator_getExecutingLine arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionGenerator_getExecutingLine arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -#define arginfo_class_ReflectionGenerator_getExecutingFile arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionGenerator_getExecutingFile arginfo_class_ReflectionFunctionAbstract_getName -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionGenerator_getTrace, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionGenerator_getTrace, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "DEBUG_BACKTRACE_PROVIDE_OBJECT") ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionGenerator_getFunction arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionGenerator_getFunction, 0, 0, ReflectionFunctionAbstract, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionGenerator_getThis arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionGenerator_getThis arginfo_class_ReflectionFunctionAbstract_getClosureThis -#define arginfo_class_ReflectionGenerator_getExecutingGenerator arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionGenerator_getExecutingGenerator, 0, 0, Generator, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod___construct, 0, 0, 1) ZEND_ARG_TYPE_MASK(0, objectOrMethod, MAY_BE_OBJECT|MAY_BE_STRING, NULL) @@ -124,27 +142,29 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionMethod_isDestructor arginfo_class_ReflectionFunctionAbstract_inNamespace -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_getClosure, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionMethod_getClosure, 0, 0, Closure, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, object, IS_OBJECT, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionMethod_getModifiers arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionMethod_getModifiers arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_invoke, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionMethod_invoke, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 1) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_invokeArgs, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionMethod_invokeArgs, 0, 2, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 1) ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionMethod_getDeclaringClass arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionMethod_getDeclaringClass, 0, 0, ReflectionClass, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionMethod_getPrototype arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionMethod_getPrototype, 0, 0, ReflectionMethod, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_setAccessible, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionMethod_setAccessible, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, accessible, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -156,7 +176,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionClass_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getName arginfo_class_ReflectionFunctionAbstract_getName #define arginfo_class_ReflectionClass_isInternal arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -168,29 +188,34 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_isCloneable arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getFileName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getFileName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionClass_getStartLine arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getStartLine arginfo_class_ReflectionFunctionAbstract_getEndLine -#define arginfo_class_ReflectionClass_getEndLine arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getEndLine arginfo_class_ReflectionFunctionAbstract_getEndLine -#define arginfo_class_ReflectionClass_getDocComment arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getDocComment arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionClass_getConstructor arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionClass_getConstructor, 0, 0, ReflectionMethod, 1) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_hasMethod, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_hasMethod, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getMethod arginfo_class_ReflectionClass_hasMethod +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionClass_getMethod, 0, 1, ReflectionMethod, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_getMethods, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_getMethods, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filter, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_hasProperty arginfo_class_ReflectionClass_hasMethod -#define arginfo_class_ReflectionClass_getProperty arginfo_class_ReflectionClass_hasMethod +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionClass_getProperty, 0, 1, ReflectionProperty, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_getProperties arginfo_class_ReflectionClass_getMethods @@ -200,86 +225,96 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_getReflectionConstants arginfo_class_ReflectionClass_getMethods -#define arginfo_class_ReflectionClass_getConstant arginfo_class_ReflectionClass_hasMethod +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_getConstant, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getReflectionConstant arginfo_class_ReflectionClass_hasMethod +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_ReflectionClass_getReflectionConstant, 0, 1, ReflectionClassConstant, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getInterfaces arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getInterfaces arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionClass_getInterfaceNames arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getInterfaceNames arginfo_class_ReflectionFunctionAbstract_getParameters #define arginfo_class_ReflectionClass_isInterface arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getTraits arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getTraits arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionClass_getTraitNames arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getTraitNames arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionClass_getTraitAliases arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getTraitAliases arginfo_class_ReflectionFunctionAbstract_getParameters #define arginfo_class_ReflectionClass_isTrait arginfo_class_ReflectionFunctionAbstract_inNamespace -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_isEnum, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionClass_isEnum arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType #define arginfo_class_ReflectionClass_isAbstract arginfo_class_ReflectionFunctionAbstract_inNamespace #define arginfo_class_ReflectionClass_isFinal arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getModifiers arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getModifiers arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_isInstance, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_isInstance, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_newInstance arginfo_class_ReflectionFunction_invoke +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_newInstance, 0, 0, IS_OBJECT, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_newInstanceWithoutConstructor arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_newInstanceWithoutConstructor, 0, 0, IS_OBJECT, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_newInstanceArgs, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_newInstanceArgs, 0, 0, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, args, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getParentClass arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_ReflectionClass_getParentClass, 0, 0, ReflectionClass, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_isSubclassOf, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_isSubclassOf, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, class, ReflectionClass, MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getStaticProperties arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_getStaticProperties, 0, 0, IS_ARRAY, 1) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_getStaticPropertyValue, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_getStaticPropertyValue, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, default, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_setStaticPropertyValue, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_setStaticPropertyValue, 0, 2, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getDefaultProperties arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getDefaultProperties arginfo_class_ReflectionFunctionAbstract_getParameters #define arginfo_class_ReflectionClass_isIterable arginfo_class_ReflectionFunctionAbstract_inNamespace #define arginfo_class_ReflectionClass_isIterateable arginfo_class_ReflectionFunctionAbstract_inNamespace -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_implementsInterface, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionClass_implementsInterface, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, interface, ReflectionClass, MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getExtension arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getExtension arginfo_class_ReflectionFunctionAbstract_getExtension -#define arginfo_class_ReflectionClass_getExtensionName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getExtensionName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionClass_inNamespace arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getNamespaceName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionClass_getShortName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClass_getShortName arginfo_class_ReflectionFunctionAbstract_getName #define arginfo_class_ReflectionClass_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes -#define arginfo_class_ReflectionObject___construct arginfo_class_ReflectionClass_isInstance +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionObject___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty___clone arginfo_class_ReflectionFunctionAbstract___clone @@ -290,16 +325,20 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionProperty_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionProperty_getName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionProperty_getValue arginfo_class_ReflectionMethod_getClosure +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionProperty_getValue, 0, 0, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, object, IS_OBJECT, 1, "null") +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty_setValue, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionProperty_setValue, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, objectOrValue, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionProperty_isInitialized arginfo_class_ReflectionMethod_getClosure +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionProperty_isInitialized, 0, 0, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, object, IS_OBJECT, 1, "null") +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty_isPublic arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -311,23 +350,24 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty_isDefault arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionProperty_isPromoted arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionProperty_isPromoted arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType -#define arginfo_class_ReflectionProperty_getModifiers arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionProperty_getModifiers arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -#define arginfo_class_ReflectionProperty_getDeclaringClass arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionProperty_getDeclaringClass arginfo_class_ReflectionMethod_getDeclaringClass -#define arginfo_class_ReflectionProperty_getDocComment arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionProperty_getDocComment arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionProperty_setAccessible arginfo_class_ReflectionMethod_setAccessible -#define arginfo_class_ReflectionProperty_getType arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionProperty_getType arginfo_class_ReflectionFunctionAbstract_getReturnType #define arginfo_class_ReflectionProperty_hasType arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionProperty_hasDefaultValue arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionProperty_hasDefaultValue arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType -#define arginfo_class_ReflectionProperty_getDefaultValue arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionProperty_getDefaultValue, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes @@ -340,9 +380,9 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClassConstant___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionClassConstant_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClassConstant_getName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionClassConstant_getValue arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClassConstant_getValue arginfo_class_ReflectionProperty_getDefaultValue #define arginfo_class_ReflectionClassConstant_isPublic arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -350,15 +390,15 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClassConstant_isProtected arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClassConstant_getModifiers arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClassConstant_getModifiers arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters -#define arginfo_class_ReflectionClassConstant_getDeclaringClass arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClassConstant_getDeclaringClass arginfo_class_ReflectionMethod_getDeclaringClass -#define arginfo_class_ReflectionClassConstant_getDocComment arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionClassConstant_getDocComment arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionClassConstant_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes -#define arginfo_class_ReflectionClassConstant_isEnumCase arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionClassConstant_isEnumCase arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType #define arginfo_class_ReflectionParameter___clone arginfo_class_ReflectionFunctionAbstract___clone @@ -369,21 +409,21 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionParameter_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getName arginfo_class_ReflectionFunctionAbstract_getName #define arginfo_class_ReflectionParameter_isPassedByReference arginfo_class_ReflectionFunctionAbstract_inNamespace #define arginfo_class_ReflectionParameter_canBePassedByValue arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_getDeclaringFunction arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getDeclaringFunction arginfo_class_ReflectionGenerator_getFunction -#define arginfo_class_ReflectionParameter_getDeclaringClass arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getDeclaringClass arginfo_class_ReflectionFunctionAbstract_getClosureScopeClass -#define arginfo_class_ReflectionParameter_getClass arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getClass arginfo_class_ReflectionFunctionAbstract_getClosureScopeClass #define arginfo_class_ReflectionParameter_hasType arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_getType arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getType arginfo_class_ReflectionFunctionAbstract_getReturnType #define arginfo_class_ReflectionParameter_isArray arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -391,21 +431,22 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter_allowsNull arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_getPosition arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getPosition arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters #define arginfo_class_ReflectionParameter_isOptional arginfo_class_ReflectionFunctionAbstract_inNamespace #define arginfo_class_ReflectionParameter_isDefaultValueAvailable arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_getDefaultValue arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionParameter_getDefaultValue arginfo_class_ReflectionProperty_getDefaultValue #define arginfo_class_ReflectionParameter_isDefaultValueConstant arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_getDefaultValueConstantName arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionParameter_getDefaultValueConstantName, 0, 0, IS_STRING, 1) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter_isVariadic arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionParameter_isPromoted arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionParameter_isPromoted arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType #define arginfo_class_ReflectionParameter_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes @@ -415,7 +456,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionType___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionNamedType_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionNamedType_getName arginfo_class_ReflectionFunctionAbstract_getName #define arginfo_class_ReflectionNamedType_isBuiltin arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -424,27 +465,30 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionExtension___clone arginfo_class_ReflectionFunctionAbstract___clone -#define arginfo_class_ReflectionExtension___construct arginfo_class_ReflectionClass_hasMethod +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionExtension___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionExtension___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionExtension_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionExtension_getVersion arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getVersion arginfo_class_ReflectionParameter_getDefaultValueConstantName -#define arginfo_class_ReflectionExtension_getFunctions arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getFunctions arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_getConstants arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getConstants arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_getINIEntries arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getINIEntries arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_getClasses arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getClasses arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_getClassNames arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getClassNames arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_getDependencies arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionExtension_getDependencies arginfo_class_ReflectionFunctionAbstract_getParameters -#define arginfo_class_ReflectionExtension_info arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionExtension_info, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionExtension_isPersistent arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -452,19 +496,19 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionZendExtension___clone arginfo_class_ReflectionFunctionAbstract___clone -#define arginfo_class_ReflectionZendExtension___construct arginfo_class_ReflectionClass_hasMethod +#define arginfo_class_ReflectionZendExtension___construct arginfo_class_ReflectionExtension___construct #define arginfo_class_ReflectionZendExtension___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionZendExtension_getName arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionZendExtension_getName arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionZendExtension_getVersion arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionZendExtension_getVersion arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionZendExtension_getAuthor arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionZendExtension_getAuthor arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionZendExtension_getURL arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionZendExtension_getURL arginfo_class_ReflectionFunctionAbstract_getName -#define arginfo_class_ReflectionZendExtension_getCopyright arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionZendExtension_getCopyright arginfo_class_ReflectionFunctionAbstract_getName ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionReference_fromArrayElement, 0, 2, ReflectionReference, 1) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) @@ -475,14 +519,15 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionReference___clone arginfo_class_ReflectionFunctionAbstract___clone -#define arginfo_class_ReflectionReference___construct arginfo_class_ReflectionFunctionAbstract_inNamespace +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionReference___construct, 0, 0, 0) +ZEND_END_ARG_INFO() #define arginfo_class_ReflectionAttribute_getName arginfo_class_ReflectionFunction___toString ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionAttribute_getTarget, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionAttribute_isRepeated arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionAttribute_isRepeated arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType #define arginfo_class_ReflectionAttribute_getArguments arginfo_class_ReflectionUnionType_getTypes @@ -491,7 +536,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionAttribute___clone arginfo_class_ReflectionFunctionAbstract___clone -#define arginfo_class_ReflectionAttribute___construct arginfo_class_ReflectionFunctionAbstract_inNamespace +#define arginfo_class_ReflectionAttribute___construct arginfo_class_ReflectionReference___construct #define arginfo_class_ReflectionEnum___construct arginfo_class_ReflectionClass___construct @@ -503,12 +548,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionEnum_getCase, 0, ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionEnum_getCases arginfo_class_ReflectionUnionType_getTypes +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionEnum_getCases, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionEnum_isBacked arginfo_class_ReflectionClass_isEnum +#define arginfo_class_ReflectionEnum_isBacked arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionEnum_getBackingType, 0, 0, ReflectionType, 1) -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionEnum_getBackingType arginfo_class_ReflectionFunctionAbstract_getTentativeReturnType #define arginfo_class_ReflectionEnumUnitCase___construct arginfo_class_ReflectionClassConstant___construct @@ -569,6 +614,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getStaticVariables); ZEND_METHOD(ReflectionFunctionAbstract, returnsReference); ZEND_METHOD(ReflectionFunctionAbstract, hasReturnType); ZEND_METHOD(ReflectionFunctionAbstract, getReturnType); +ZEND_METHOD(ReflectionFunctionAbstract, hasTentativeReturnType); +ZEND_METHOD(ReflectionFunctionAbstract, getTentativeReturnType); ZEND_METHOD(ReflectionFunctionAbstract, getAttributes); ZEND_METHOD(ReflectionFunction, __construct); ZEND_METHOD(ReflectionFunction, __toString); @@ -805,6 +852,8 @@ static const zend_function_entry class_ReflectionFunctionAbstract_methods[] = { ZEND_ME(ReflectionFunctionAbstract, returnsReference, arginfo_class_ReflectionFunctionAbstract_returnsReference, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionFunctionAbstract, hasReturnType, arginfo_class_ReflectionFunctionAbstract_hasReturnType, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionFunctionAbstract, getReturnType, arginfo_class_ReflectionFunctionAbstract_getReturnType, ZEND_ACC_PUBLIC) + ZEND_ME(ReflectionFunctionAbstract, hasTentativeReturnType, arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType, ZEND_ACC_PUBLIC) + ZEND_ME(ReflectionFunctionAbstract, getTentativeReturnType, arginfo_class_ReflectionFunctionAbstract_getTentativeReturnType, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionFunctionAbstract, getAttributes, arginfo_class_ReflectionFunctionAbstract_getAttributes, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/ext/reflection/tests/ReflectionMethod_tentative_return_type.phpt b/ext/reflection/tests/ReflectionMethod_tentative_return_type.phpt new file mode 100644 index 0000000000000..3f11b17c7062f --- /dev/null +++ b/ext/reflection/tests/ReflectionMethod_tentative_return_type.phpt @@ -0,0 +1,41 @@ +--TEST-- +ReflectionMethod returns tentative return type information correctly +--FILE-- +hasReturnType()); +var_dump($methodInfo->hasTentativeReturnType()); +var_dump($methodInfo->getReturnType()); +var_dump((string) $methodInfo->getTentativeReturnType()); +echo "\n"; + +$methodInfo = new ReflectionMethod(MyDateTimeZone::class, 'listIdentifiers'); + +var_dump($methodInfo->hasReturnType()); +var_dump($methodInfo->hasTentativeReturnType()); +var_dump((string) $methodInfo->getReturnType()); +var_dump($methodInfo->getTentativeReturnType()); +echo "\n"; + +?> +--EXPECTF-- +bool(false) +bool(true) +NULL +string(5) "array" + +bool(true) +bool(false) +string(6) "string" +NULL diff --git a/ext/session/session_arginfo.h b/ext/session/session_arginfo.h index 89c3707009599..c66cf9e0bf527 100644 --- a/ext/session/session_arginfo.h +++ b/ext/session/session_arginfo.h @@ -89,32 +89,35 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_start, 0, 0, _IS_BOOL, 0 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_open, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SessionHandlerInterface_open, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_close, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SessionHandlerInterface_close, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_read, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SessionHandlerInterface_read, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_write, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SessionHandlerInterface_write, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_SessionHandlerInterface_destroy arginfo_class_SessionHandlerInterface_read +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SessionHandlerInterface_destroy, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_gc, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SessionHandlerInterface_gc, 0, 1, MAY_BE_LONG|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, max_lifetime, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_SessionIdInterface_create_sid arginfo_class_SessionHandlerInterface_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SessionIdInterface_create_sid, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SessionUpdateTimestampHandlerInterface_validateId arginfo_class_SessionHandlerInterface_read +#define arginfo_class_SessionUpdateTimestampHandlerInterface_validateId arginfo_class_SessionHandlerInterface_destroy #define arginfo_class_SessionUpdateTimestampHandlerInterface_updateTimestamp arginfo_class_SessionHandlerInterface_write @@ -126,11 +129,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_SessionHandler_write arginfo_class_SessionHandlerInterface_write -#define arginfo_class_SessionHandler_destroy arginfo_class_SessionHandlerInterface_read +#define arginfo_class_SessionHandler_destroy arginfo_class_SessionHandlerInterface_destroy #define arginfo_class_SessionHandler_gc arginfo_class_SessionHandlerInterface_gc -#define arginfo_class_SessionHandler_create_sid arginfo_class_SessionHandlerInterface_close +#define arginfo_class_SessionHandler_create_sid arginfo_class_SessionIdInterface_create_sid ZEND_FUNCTION(session_name); diff --git a/ext/session/tests/bug70133.phpt b/ext/session/tests/bug70133.phpt index 3e019e483baf2..2a10e3121d366 100644 --- a/ext/session/tests/bug70133.phpt +++ b/ext/session/tests/bug70133.phpt @@ -11,7 +11,7 @@ session.use_strict_mode=0 class CustomReadHandler extends \SessionHandler { - public function read($session_id) { + public function read($session_id): string|false { return parent::read('mycustomsession'); } } diff --git a/ext/session/tests/bug71162.phpt b/ext/session/tests/bug71162.phpt index b475ae6080932..404be1a5f36b5 100644 --- a/ext/session/tests/bug71162.phpt +++ b/ext/session/tests/bug71162.phpt @@ -11,40 +11,40 @@ Current session module is designed to write empty session always. In addition, c i; echo 'Open ', session_id(), "\n"; return parent::open($path, $name); } - public function create_sid() { + public function create_sid(): string { // This method should be removed when 5.5 become unsupported. ++$this->i; echo 'Old Create SID ', session_id(), "\n"; return parent::create_sid(); } - public function read($key) { + public function read($key): string|false { ++$this->i; echo 'Read ', session_id(), "\n"; return parent::read($key); } - public function write($key, $data) { + public function write($key, $data): bool { ++$this->i; echo 'Write ', session_id(), "\n"; return parent::write($key, $data); } - public function close() { + public function close(): bool { ++$this->i; echo 'Close ', session_id(), "\n"; return parent::close(); } - public function createSid() { + public function createSid(): string { // User should use this rather than create_sid() // If both create_sid() and createSid() exists, // createSid() is used. @@ -49,7 +49,7 @@ class MySession extends SessionHandler { echo 'New Create ID ', session_id(), "\n"; return parent::create_sid(); } - public function validateId($key) { + public function validateId($key): bool { ++$this->i; echo 'Validate ID ', session_id(), "\n"; return TRUE; @@ -57,7 +57,7 @@ class MySession extends SessionHandler { // cannot call parent as follows. // return parent::validateSid($key); } - public function updateTimestamp($key, $data) { + public function updateTimestamp($key, $data): bool { ++$this->i; echo 'Update Timestamp ', session_id(), "\n"; return parent::write($key, $data); diff --git a/ext/session/tests/session_set_save_handler_class_002.phpt b/ext/session/tests/session_set_save_handler_class_002.phpt index 9a4a3a17936b9..ffab1ed83866b 100644 --- a/ext/session/tests/session_set_save_handler_class_002.phpt +++ b/ext/session/tests/session_set_save_handler_class_002.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() : full handler implementation ***\n class MySession2 extends SessionHandler { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,24 +23,24 @@ class MySession2 extends SessionHandler { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return (bool)file_put_contents($this->path . $id, $data); } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); return true; } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); diff --git a/ext/session/tests/session_set_save_handler_class_003.phpt b/ext/session/tests/session_set_save_handler_class_003.phpt index fe83c57d4cef8..b952a7ca9b7c9 100644 --- a/ext/session/tests/session_set_save_handler_class_003.phpt +++ b/ext/session/tests/session_set_save_handler_class_003.phpt @@ -14,18 +14,18 @@ echo "*** Testing session_set_save_handler() : inheritance ***\n"; class MySession3 extends SessionHandler { public $i = 0; - public function open($path, $name) { + public function open($path, $name): bool { ++$this->i; return parent::open($path, $name); } - public function read($key) { + public function read($key): string|false { ++$this->i; return parent::read($key); } } class MySession4 extends MySession3 { - public function write($id, $data) { + public function write($id, $data): bool { $this->i = "hai"; return parent::write($id, $data); } diff --git a/ext/session/tests/session_set_save_handler_class_005.phpt b/ext/session/tests/session_set_save_handler_class_005.phpt index cd2d831a01b26..00ff0df972001 100644 --- a/ext/session/tests/session_set_save_handler_class_005.phpt +++ b/ext/session/tests/session_set_save_handler_class_005.phpt @@ -14,12 +14,12 @@ ob_start(); echo "*** Testing session_set_save_handler() : incomplete implementation ***\n"; class MySession6 extends SessionHandler { - public function open($path, $name) { + public function open($path, $name): bool { // don't call parent return true; } - public function read($id) { + public function read($id): string|false { // should error because parent::open hasn't been called return parent::read($id); } diff --git a/ext/session/tests/session_set_save_handler_class_006.phpt b/ext/session/tests/session_set_save_handler_class_006.phpt index 161fb46d580a2..97b21e26e07e6 100644 --- a/ext/session/tests/session_set_save_handler_class_006.phpt +++ b/ext/session/tests/session_set_save_handler_class_006.phpt @@ -21,7 +21,7 @@ class MySession7_Foo { class MySession7 extends SessionHandler { public $foo; - public function close() { + public function close(): bool { var_dump($this->foo); @var_dump($GLOBALS['bar']); return parent::close(); diff --git a/ext/session/tests/session_set_save_handler_class_007.phpt b/ext/session/tests/session_set_save_handler_class_007.phpt index 5ace4fb9f13b6..d31e8750d2302 100644 --- a/ext/session/tests/session_set_save_handler_class_007.phpt +++ b/ext/session/tests/session_set_save_handler_class_007.phpt @@ -26,11 +26,11 @@ class MySession extends SessionHandler { echo "(#$this->num) finish called $id\n"; session_write_close(); } - public function write($id, $data) { + public function write($id, $data): bool { echo "(#$this->num) writing $id = $data\n"; return parent::write($id, $data); } - public function close() { + public function close(): bool { $id = session_id(); echo "(#$this->num) closing $id\n"; return parent::close(); diff --git a/ext/session/tests/session_set_save_handler_class_008.phpt b/ext/session/tests/session_set_save_handler_class_008.phpt index 227fe00961a9c..d9f81c4f524ff 100644 --- a/ext/session/tests/session_set_save_handler_class_008.phpt +++ b/ext/session/tests/session_set_save_handler_class_008.phpt @@ -26,11 +26,11 @@ class MySession extends SessionHandler { echo "(#$this->num) finish called $id\n"; session_write_close(); } - public function write($id, $data) { + public function write($id, $data): bool { echo "(#$this->num) writing $id = $data\n"; return parent::write($id, $data); } - public function close() { + public function close(): bool { $id = session_id(); echo "(#$this->num) closing $id\n"; return parent::close(); diff --git a/ext/session/tests/session_set_save_handler_class_009.phpt b/ext/session/tests/session_set_save_handler_class_009.phpt index 65e273d5e7288..c27b9b234789a 100644 --- a/ext/session/tests/session_set_save_handler_class_009.phpt +++ b/ext/session/tests/session_set_save_handler_class_009.phpt @@ -26,11 +26,11 @@ class MySession extends SessionHandler { echo "(#$this->num) finish called $id\n"; $this->shutdown(); } - public function write($id, $data) { + public function write($id, $data): bool { echo "(#$this->num) writing $id = $data\n"; return parent::write($id, $data); } - public function close() { + public function close(): bool { $id = session_id(); echo "(#$this->num) closing $id\n"; return parent::close(); diff --git a/ext/session/tests/session_set_save_handler_class_010.phpt b/ext/session/tests/session_set_save_handler_class_010.phpt index c81fce49635ee..39ae04b4952dc 100644 --- a/ext/session/tests/session_set_save_handler_class_010.phpt +++ b/ext/session/tests/session_set_save_handler_class_010.phpt @@ -26,11 +26,11 @@ class MySession extends SessionHandler { echo "(#$this->num) finish called $id\n"; session_write_close(); } - public function write($id, $data) { + public function write($id, $data): bool { echo "(#$this->num) writing $id = $data\n"; return parent::write($id, $data); } - public function close() { + public function close(): bool { $id = session_id(); echo "(#$this->num) closing $id\n"; return parent::close(); diff --git a/ext/session/tests/session_set_save_handler_class_011.phpt b/ext/session/tests/session_set_save_handler_class_011.phpt index 04defe937e491..a3811d2d9a152 100644 --- a/ext/session/tests/session_set_save_handler_class_011.phpt +++ b/ext/session/tests/session_set_save_handler_class_011.phpt @@ -23,7 +23,7 @@ class MySession extends SessionHandler { echo "(#$this->num) destructor called\n"; $this->destroyed = true; } - public function write($id, $data) { + public function write($id, $data): bool { if ($this->destroyed) { echo "(#$this->num) destroyed, cannot write\n"; } else { @@ -31,7 +31,7 @@ class MySession extends SessionHandler { } return parent::write($id, $data); } - public function close() { + public function close(): bool { $id = session_id(); if ($this->destroyed) { echo "(#$this->num) destroyed, cannot write\n"; diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index 2d55715544729..a6f53f6143026 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -15,14 +15,14 @@ echo "*** Testing session_set_save_handler() : incorrect arguments for existing class MySession extends SessionHandler { public $i = 0; - public function open($path, $name) { + public function open($path, $name): bool { ++$this->i; echo 'Open ', session_id(), "\n"; // This test was written for broken return value handling // Mimmick what was actually being tested by returning true here return (null === parent::open()); } - public function read($key) { + public function read($key): string|false { ++$this->i; echo 'Read ', session_id(), "\n"; return parent::read($key); diff --git a/ext/session/tests/session_set_save_handler_class_013.phpt b/ext/session/tests/session_set_save_handler_class_013.phpt index be701d3c5cb5e..1f8b5445cc4a9 100644 --- a/ext/session/tests/session_set_save_handler_class_013.phpt +++ b/ext/session/tests/session_set_save_handler_class_013.phpt @@ -14,17 +14,17 @@ echo "*** Testing session_set_save_handler() : incorrect arguments for existing class MySession extends SessionHandler { public $i = 0; - public function open($path, $name) { + public function open($path, $name): bool { ++$this->i; echo 'Open ', session_id(), "\n"; return parent::open($path, $name); } - public function read($key) { + public function read($key): string|false { ++$this->i; echo 'Read ', session_id(), "\n"; return parent::read($key); } - public function close() { + public function close(): bool { return parent::close(false); } } diff --git a/ext/session/tests/session_set_save_handler_class_016.phpt b/ext/session/tests/session_set_save_handler_class_016.phpt index 60654a49d60c0..804a52411e889 100644 --- a/ext/session/tests/session_set_save_handler_class_016.phpt +++ b/ext/session/tests/session_set_save_handler_class_016.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: class with create_sid *** class MySession2 extends SessionHandler { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,23 +23,24 @@ class MySession2 extends SessionHandler { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return (bool)file_put_contents($this->path . $id, $data); } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); + return true; } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); @@ -48,7 +49,7 @@ class MySession2 extends SessionHandler { return true; } - public function create_sid() { + public function create_sid(): string { return parent::create_sid(); } } diff --git a/ext/session/tests/session_set_save_handler_class_017.phpt b/ext/session/tests/session_set_save_handler_class_017.phpt index 4cd100302f259..89ea09834ef69 100644 --- a/ext/session/tests/session_set_save_handler_class_017.phpt +++ b/ext/session/tests/session_set_save_handler_class_017.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: class with create_sid *** class MySession2 extends SessionHandler { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,23 +23,23 @@ class MySession2 extends SessionHandler { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return (bool)file_put_contents($this->path . $id, $data); } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); @@ -48,7 +48,7 @@ class MySession2 extends SessionHandler { return true; } - public function create_sid() { + public function create_sid(): string { return pathinfo(__FILE__)['filename']; } } diff --git a/ext/session/tests/session_set_save_handler_class_018.phpt b/ext/session/tests/session_set_save_handler_class_018.phpt index dd1fe2129c8fe..955095ab77c61 100644 --- a/ext/session/tests/session_set_save_handler_class_018.phpt +++ b/ext/session/tests/session_set_save_handler_class_018.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: class with validate_sid * class MySession2 extends SessionHandler { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,23 +23,24 @@ class MySession2 extends SessionHandler { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return file_put_contents($this->path . $id, $data)===FALSE ? FALSE : TRUE ; } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); + return true; } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); @@ -48,11 +49,11 @@ class MySession2 extends SessionHandler { return true; } - public function create_sid() { + public function create_sid(): string { return pathinfo(__FILE__)['filename']; } - public function validate_sid($id) { + public function validate_sid($id): bool { return pathinfo(__FILE__)['filename']===$id; } } diff --git a/ext/session/tests/session_set_save_handler_iface_001.phpt b/ext/session/tests/session_set_save_handler_iface_001.phpt index 53c99cfdb867a..31e114bd13ad8 100644 --- a/ext/session/tests/session_set_save_handler_iface_001.phpt +++ b/ext/session/tests/session_set_save_handler_iface_001.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: interface ***\n"; class MySession2 implements SessionHandlerInterface { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,23 +23,24 @@ class MySession2 implements SessionHandlerInterface { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return (bool)file_put_contents($this->path . $id, $data); } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); + return true; } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt index 10971a2b5f031..10ce19bdcbab6 100644 --- a/ext/session/tests/session_set_save_handler_iface_002.phpt +++ b/ext/session/tests/session_set_save_handler_iface_002.phpt @@ -24,7 +24,7 @@ interface MySessionHandlerInterface { class MySession2 implements MySessionHandlerInterface { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -32,11 +32,11 @@ class MySession2 implements MySessionHandlerInterface { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } @@ -48,7 +48,7 @@ class MySession2 implements MySessionHandlerInterface { @unlink($this->path . $id); } - public function gc($maxlifetime) { + public function gc($maxlifetime): bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); diff --git a/ext/session/tests/session_set_save_handler_iface_003.phpt b/ext/session/tests/session_set_save_handler_iface_003.phpt index 582942f185eb4..3c5155b9899d8 100644 --- a/ext/session/tests/session_set_save_handler_iface_003.phpt +++ b/ext/session/tests/session_set_save_handler_iface_003.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: id interface ***\n"; class MySession2 implements SessionHandlerInterface, SessionIdInterface { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,24 +23,25 @@ class MySession2 implements SessionHandlerInterface, SessionIdInterface { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { // Empty $data = 0 = false return (bool)file_put_contents($this->path . $id, $data); } - public function destroy($id) { + public function destroy($id): bool { @unlink($this->path . $id); + return true; } - public function gc($maxlifetime) { + public function gc($maxlifetime): int|bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); @@ -49,7 +50,7 @@ class MySession2 implements SessionHandlerInterface, SessionIdInterface { return true; } - public function create_sid() { + public function create_sid(): string { return pathinfo(__FILE__)['filename']; } } diff --git a/ext/session/tests/session_set_save_handler_sid_001.phpt b/ext/session/tests/session_set_save_handler_sid_001.phpt index 76d3f256bf7e3..12f607f540a30 100644 --- a/ext/session/tests/session_set_save_handler_sid_001.phpt +++ b/ext/session/tests/session_set_save_handler_sid_001.phpt @@ -15,7 +15,7 @@ echo "*** Testing session_set_save_handler() function: create_sid ***\n"; class MySession2 { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -23,15 +23,15 @@ class MySession2 { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string { return (string)@file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { // Empty $data = 0 = false return (bool)file_put_contents($this->path . $id, $data); } @@ -40,7 +40,7 @@ class MySession2 { @unlink($this->path . $id); } - public function gc($maxlifetime) { + public function gc($maxlifetime): bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); diff --git a/ext/session/tests/session_set_save_handler_sid_002.phpt b/ext/session/tests/session_set_save_handler_sid_002.phpt index 6321c5a5681c8..ec54a3092b178 100644 --- a/ext/session/tests/session_set_save_handler_sid_002.phpt +++ b/ext/session/tests/session_set_save_handler_sid_002.phpt @@ -16,7 +16,7 @@ echo "*** Testing session_set_save_handler() function: create_sid ***\n"; class MySession2 { public $path; - public function open($path, $name) { + public function open($path, $name): bool { if (!$path) { $path = sys_get_temp_dir(); } @@ -24,15 +24,15 @@ class MySession2 { return true; } - public function close() { + public function close(): bool { return true; } - public function read($id) { + public function read($id): string|false { return @file_get_contents($this->path . $id); } - public function write($id, $data) { + public function write($id, $data): bool { return file_put_contents($this->path . $id, $data); } @@ -40,7 +40,7 @@ class MySession2 { @unlink($this->path . $id); } - public function gc($maxlifetime) { + public function gc($maxlifetime): bool { foreach (glob($this->path . '*') as $filename) { if (filemtime($filename) + $maxlifetime < time()) { @unlink($filename); diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h index 98bfa6c0596f3..8c4148fec2b0d 100644 --- a/ext/simplexml/simplexml_arginfo.h +++ b/ext/simplexml/simplexml_arginfo.h @@ -22,31 +22,31 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_simplexml_import_dom, 0, 1, Simpl ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 1, "SimpleXMLElement::class") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_xpath, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SimpleXMLElement_xpath, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, expression, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_registerXPathNamespace, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_registerXPathNamespace, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_asXML, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SimpleXMLElement_asXML, 0, 0, MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #define arginfo_class_SimpleXMLElement_saveXML arginfo_class_SimpleXMLElement_asXML -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_getNamespaces, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_getNamespaces, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_getDocNamespaces, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SimpleXMLElement_getDocNamespaces, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fromRoot, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_children, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_SimpleXMLElement_children, 0, 0, SimpleXMLIterator, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespaceOrPrefix, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, isPrefix, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -61,7 +61,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, isPrefix, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_addChild, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_SimpleXMLElement_addChild, 0, 1, SimpleXMLElement, 0) ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespace, IS_STRING, 1, "null") @@ -69,27 +69,32 @@ ZEND_END_ARG_INFO() #define arginfo_class_SimpleXMLElement_addAttribute arginfo_class_SimpleXMLElement_addChild -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_getName, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_getName, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement___toString, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_count arginfo_class_SimpleXMLElement_getName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_rewind arginfo_class_SimpleXMLElement_getName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_rewind, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_valid arginfo_class_SimpleXMLElement_getName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleXMLElement_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_current arginfo_class_SimpleXMLElement_getName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_SimpleXMLElement_current, 0, 0, SimpleXMLElement, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_key arginfo_class_SimpleXMLElement_getName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SimpleXMLElement_key, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_SimpleXMLElement_next arginfo_class_SimpleXMLElement_getName +#define arginfo_class_SimpleXMLElement_next arginfo_class_SimpleXMLElement_rewind -#define arginfo_class_SimpleXMLElement_hasChildren arginfo_class_SimpleXMLElement_getName +#define arginfo_class_SimpleXMLElement_hasChildren arginfo_class_SimpleXMLElement_valid -#define arginfo_class_SimpleXMLElement_getChildren arginfo_class_SimpleXMLElement_getName +#define arginfo_class_SimpleXMLElement_getChildren arginfo_class_SimpleXMLElement_current ZEND_FUNCTION(simplexml_load_file); diff --git a/ext/simplexml/tests/036.phpt b/ext/simplexml/tests/036.phpt index 9c54994eeddee..44c087beb819e 100644 --- a/ext/simplexml/tests/036.phpt +++ b/ext/simplexml/tests/036.phpt @@ -5,7 +5,7 @@ simplexml --FILE-- server->addFunction('echoAnyElement'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bug47021.phpt b/ext/soap/tests/bug47021.phpt index d3bd9dfdd695b..ffe899cfca6d8 100644 --- a/ext/soap/tests/bug47021.phpt +++ b/ext/soap/tests/bug47021.phpt @@ -56,7 +56,7 @@ $options = [ class BugSoapClient extends SoapClient { - public function __doRequest($request, $location, $action, $version, $one_way = null) + public function __doRequest($request, $location, $action, $version, $one_way = null): ?string { $response = parent::__doRequest($request, $location, $action, $version, $one_way); diff --git a/ext/soap/tests/bug69668.phpt b/ext/soap/tests/bug69668.phpt index 88785ca799370..bf7e4c5ffa2a0 100644 --- a/ext/soap/tests/bug69668.phpt +++ b/ext/soap/tests/bug69668.phpt @@ -5,7 +5,7 @@ soap --FILE-- '', 'uri' => 'http://example.org']) extends SoapClient { - public function __doRequest($request, $location, $action, $version, $one_way = 0) { + public function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo $request; return ''; } diff --git a/ext/soap/tests/bug71996.phpt b/ext/soap/tests/bug71996.phpt index 5924aa2dfad24..18fb3fb180e65 100644 --- a/ext/soap/tests/bug71996.phpt +++ b/ext/soap/tests/bug71996.phpt @@ -6,7 +6,7 @@ soap '', 'uri' => 'http://example.org']) extends SoapClient { - public function __doRequest($request, $location, $action, $version, $one_way = 0) { + public function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo $request, "\n"; return ''; } diff --git a/ext/soap/tests/bug77410.phpt b/ext/soap/tests/bug77410.phpt index 5319a8f417355..645558f2ab87a 100644 --- a/ext/soap/tests/bug77410.phpt +++ b/ext/soap/tests/bug77410.phpt @@ -9,7 +9,7 @@ $client = new class(__DIR__ . '/bug77410.wsdl', [ 'cache_wsdl' => WSDL_CACHE_NONE, 'trace' => 1, ]) extends SoapClient { - public function __doRequest($request, $location, $action, $version, $one_way = 0) { + public function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo $request, "\n"; return ''; } diff --git a/ext/soap/tests/bugs/bug28969.phpt b/ext/soap/tests/bugs/bug28969.phpt index 37c81cac78bcb..dff895017ab30 100644 --- a/ext/soap/tests/bugs/bug28969.phpt +++ b/ext/soap/tests/bugs/bug28969.phpt @@ -17,7 +17,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug29795.phpt b/ext/soap/tests/bugs/bug29795.phpt index 109bc37f5ab6a..f21e61ca2fd01 100644 --- a/ext/soap/tests/bugs/bug29795.phpt +++ b/ext/soap/tests/bugs/bug29795.phpt @@ -12,7 +12,7 @@ class LocalSoapClient extends SoapClient { parent::__construct($wsdl, $options); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { return <<server->addFunction('EchoString'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug29844.phpt b/ext/soap/tests/bugs/bug29844.phpt index 87faf9fc69879..7b403374158e7 100644 --- a/ext/soap/tests/bugs/bug29844.phpt +++ b/ext/soap/tests/bugs/bug29844.phpt @@ -21,7 +21,7 @@ class LocalSoapClient extends SoapClient { $this->server->setClass('hello_world'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug30045.phpt b/ext/soap/tests/bugs/bug30045.phpt index 3c2a0b85865a6..debb613fc9e4d 100644 --- a/ext/soap/tests/bugs/bug30045.phpt +++ b/ext/soap/tests/bugs/bug30045.phpt @@ -20,7 +20,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('foo'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { $xml = simplexml_load_string($request); echo $xml->children("http://schemas.xmlsoap.org/soap/envelope/")->Body->children("http://test-uri")->children()->param1->asXML(),"\n"; unset($xml); diff --git a/ext/soap/tests/bugs/bug30106.phpt b/ext/soap/tests/bugs/bug30106.phpt index 40f2fa173ad1e..023bd44272861 100644 --- a/ext/soap/tests/bugs/bug30106.phpt +++ b/ext/soap/tests/bugs/bug30106.phpt @@ -19,7 +19,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction("getContinentList"); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo $request; ob_start(); $this->server->handle($request); diff --git a/ext/soap/tests/bugs/bug30175.phpt b/ext/soap/tests/bugs/bug30175.phpt index 396d554def471..98e4bf30f3164 100644 --- a/ext/soap/tests/bugs/bug30175.phpt +++ b/ext/soap/tests/bugs/bug30175.phpt @@ -9,7 +9,7 @@ soap.wsdl_cache_enabled=0 class LocalSoapClient extends SoapClient { - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { return << server->addFunction('test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug31695.phpt b/ext/soap/tests/bugs/bug31695.phpt index 62345827eabb3..3ea026415097c 100644 --- a/ext/soap/tests/bugs/bug31695.phpt +++ b/ext/soap/tests/bugs/bug31695.phpt @@ -17,7 +17,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction("Test"); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo "$location\n"; ob_start(); $this->server->handle($request); diff --git a/ext/soap/tests/bugs/bug32776.phpt b/ext/soap/tests/bugs/bug32776.phpt index 257cb50e992c0..245ea224f9051 100644 --- a/ext/soap/tests/bugs/bug32776.phpt +++ b/ext/soap/tests/bugs/bug32776.phpt @@ -22,7 +22,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug32941.phpt b/ext/soap/tests/bugs/bug32941.phpt index dda282edfc780..6c1d5b2cb6174 100644 --- a/ext/soap/tests/bugs/bug32941.phpt +++ b/ext/soap/tests/bugs/bug32941.phpt @@ -5,7 +5,7 @@ soap --FILE-- server->addFunction('EchoString'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug34643.phpt b/ext/soap/tests/bugs/bug34643.phpt index 651027b1b17a1..c33b1336cfc3a 100644 --- a/ext/soap/tests/bugs/bug34643.phpt +++ b/ext/soap/tests/bugs/bug34643.phpt @@ -22,7 +22,7 @@ class LocalSoapClient extends SoapClient { $this->server->setClass('fp'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug35142.phpt b/ext/soap/tests/bugs/bug35142.phpt index 9bc4e308701dd..fea08d33c5800 100644 --- a/ext/soap/tests/bugs/bug35142.phpt +++ b/ext/soap/tests/bugs/bug35142.phpt @@ -24,7 +24,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('PostEvents'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo "$request\n"; $this->server->handle($request); return $response; diff --git a/ext/soap/tests/bugs/bug35273.phpt b/ext/soap/tests/bugs/bug35273.phpt index c2839ed793b0e..11d8a024fa873 100644 --- a/ext/soap/tests/bugs/bug35273.phpt +++ b/ext/soap/tests/bugs/bug35273.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- server->addFunction('PostEvents'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo "$request\n"; $this->server->handle($request); return $response; diff --git a/ext/soap/tests/bugs/bug36226.phpt b/ext/soap/tests/bugs/bug36226.phpt index eec034438c8fb..a0eac843a21df 100644 --- a/ext/soap/tests/bugs/bug36226.phpt +++ b/ext/soap/tests/bugs/bug36226.phpt @@ -24,7 +24,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('PostEvents'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { echo "$request\n"; $this->server->handle($request); return $response; diff --git a/ext/soap/tests/bugs/bug36999.phpt b/ext/soap/tests/bugs/bug36999.phpt index 150cdad6a1504..3bb5561fa67ad 100644 --- a/ext/soap/tests/bugs/bug36999.phpt +++ b/ext/soap/tests/bugs/bug36999.phpt @@ -19,7 +19,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('echoLong'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug37083.phpt b/ext/soap/tests/bugs/bug37083.phpt index 55a6278078df5..554a0b62464b7 100644 --- a/ext/soap/tests/bugs/bug37083.phpt +++ b/ext/soap/tests/bugs/bug37083.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache=3 --FILE-- diff --git a/ext/soap/tests/bugs/bug38004.phpt b/ext/soap/tests/bugs/bug38004.phpt index 1113ae73a4ce0..9459faa6493bf 100644 --- a/ext/soap/tests/bugs/bug38004.phpt +++ b/ext/soap/tests/bugs/bug38004.phpt @@ -19,7 +19,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('Test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug38005.phpt b/ext/soap/tests/bugs/bug38005.phpt index 0efa8e0395403..c025c14c12946 100644 --- a/ext/soap/tests/bugs/bug38005.phpt +++ b/ext/soap/tests/bugs/bug38005.phpt @@ -17,7 +17,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('Test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug38055.phpt b/ext/soap/tests/bugs/bug38055.phpt index 5a9c1d5d36a12..6c8744cc8bb89 100644 --- a/ext/soap/tests/bugs/bug38055.phpt +++ b/ext/soap/tests/bugs/bug38055.phpt @@ -20,7 +20,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('Test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug38067.phpt b/ext/soap/tests/bugs/bug38067.phpt index a5f4a05569759..778d429373f2a 100644 --- a/ext/soap/tests/bugs/bug38067.phpt +++ b/ext/soap/tests/bugs/bug38067.phpt @@ -19,7 +19,7 @@ class TestSoapClient extends SoapClient { $this->server->addFunction('Test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug38536.phpt b/ext/soap/tests/bugs/bug38536.phpt index 59b432ab46d9c..fb5dcc239568e 100644 --- a/ext/soap/tests/bugs/bug38536.phpt +++ b/ext/soap/tests/bugs/bug38536.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- diff --git a/ext/soap/tests/bugs/bug39815.phpt b/ext/soap/tests/bugs/bug39815.phpt index c67614a7972c1..688c995822daf 100644 --- a/ext/soap/tests/bugs/bug39815.phpt +++ b/ext/soap/tests/bugs/bug39815.phpt @@ -23,7 +23,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug42692.phpt b/ext/soap/tests/bugs/bug42692.phpt index 42869ad7eec6c..e132672342e8f 100644 --- a/ext/soap/tests/bugs/bug42692.phpt +++ b/ext/soap/tests/bugs/bug42692.phpt @@ -18,7 +18,7 @@ class TestSoap extends SoapClient { $this->server->addFunction("checkAuth"); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug43045.phpt b/ext/soap/tests/bugs/bug43045.phpt index 4f696c21bd476..633b22ef35388 100644 --- a/ext/soap/tests/bugs/bug43045.phpt +++ b/ext/soap/tests/bugs/bug43045.phpt @@ -14,7 +14,7 @@ class TestSoapClient extends SoapClient { $this->server = new SoapServer($wsdl, $options); $this->server->addFunction('test'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug44882.phpt b/ext/soap/tests/bugs/bug44882.phpt index b8b375ceb2e60..2a6fa526d4d6a 100644 --- a/ext/soap/tests/bugs/bug44882.phpt +++ b/ext/soap/tests/bugs/bug44882.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 diff --git a/ext/soap/tests/bugs/bug46419.phpt b/ext/soap/tests/bugs/bug46419.phpt index 7f7eb839e3e81..092cbaa7797f1 100644 --- a/ext/soap/tests/bugs/bug46419.phpt +++ b/ext/soap/tests/bugs/bug46419.phpt @@ -16,7 +16,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('bar'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug50675.phpt b/ext/soap/tests/bugs/bug50675.phpt index 51cf4942bda5b..8eade05686571 100644 --- a/ext/soap/tests/bugs/bug50675.phpt +++ b/ext/soap/tests/bugs/bug50675.phpt @@ -6,7 +6,7 @@ soap server->setObject(new testSoap()); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/bugs/bug54911.phpt b/ext/soap/tests/bugs/bug54911.phpt index 217923fe9656a..0a652cd297726 100644 --- a/ext/soap/tests/bugs/bug54911.phpt +++ b/ext/soap/tests/bugs/bug54911.phpt @@ -5,7 +5,7 @@ soap --FILE-- diff --git a/ext/soap/tests/bugs/bug73237.phpt b/ext/soap/tests/bugs/bug73237.phpt index e9d7c19edb0c2..83630b8add7f9 100644 --- a/ext/soap/tests/bugs/bug73237.phpt +++ b/ext/soap/tests/bugs/bug73237.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- trueCampaignMember00vi0000011VMgeAAG00vi0000011VMgeAAG701i0000001lreeAAASent00Qi000001UrbYFEAZLeadangela.lansbury@cbs.com1 EOF; diff --git a/ext/soap/tests/classmap002.phpt b/ext/soap/tests/classmap002.phpt index 3d78ea37534d1..6f27094ebf94d 100644 --- a/ext/soap/tests/classmap002.phpt +++ b/ext/soap/tests/classmap002.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- diff --git a/ext/soap/tests/classmap003.phpt b/ext/soap/tests/classmap003.phpt index f33434107f85b..c3181bb95249e 100644 --- a/ext/soap/tests/classmap003.phpt +++ b/ext/soap/tests/classmap003.phpt @@ -33,7 +33,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction("f"); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/classmap004.phpt b/ext/soap/tests/classmap004.phpt index f1069a9f390fe..541a336437868 100644 --- a/ext/soap/tests/classmap004.phpt +++ b/ext/soap/tests/classmap004.phpt @@ -41,7 +41,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction("f"); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/transport001.phpt b/ext/soap/tests/transport001.phpt index 6f3f4374ad04b..c2ceb913fd79c 100644 --- a/ext/soap/tests/transport001.phpt +++ b/ext/soap/tests/transport001.phpt @@ -16,7 +16,7 @@ class LocalSoapClient extends SoapClient { $this->server->addFunction('Add'); } - function __doRequest($request, $location, $action, $version, $one_way = 0) { + function __doRequest($request, $location, $action, $version, $one_way = 0): ?string { ob_start(); $this->server->handle($request); $response = ob_get_contents(); diff --git a/ext/soap/tests/typemap003.phpt b/ext/soap/tests/typemap003.phpt index 301ba257251b0..c1b205bef8582 100644 --- a/ext/soap/tests/typemap003.phpt +++ b/ext/soap/tests/typemap003.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- diff --git a/ext/soap/tests/typemap004.phpt b/ext/soap/tests/typemap004.phpt index d6be88fb5da00..f180a0130350a 100644 --- a/ext/soap/tests/typemap004.phpt +++ b/ext/soap/tests/typemap004.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- diff --git a/ext/soap/tests/typemap008.phpt b/ext/soap/tests/typemap008.phpt index b36ecdcb73071..00e89e3cd260e 100644 --- a/ext/soap/tests/typemap008.phpt +++ b/ext/soap/tests/typemap008.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- diff --git a/ext/soap/tests/typemap012.phpt b/ext/soap/tests/typemap012.phpt index 9978299ac3404..963589879d5af 100644 --- a/ext/soap/tests/typemap012.phpt +++ b/ext/soap/tests/typemap012.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- offsetGet($o1); class MySplObjectStorage extends SplObjectStorage { + #[ReturnTypeWillChange] public function getHash($obj) { return 2; } @@ -22,9 +23,8 @@ try { } class MySplObjectStorage2 extends SplObjectStorage { - public function getHash($obj) { + public function getHash($obj): string { throw new Exception("foo"); - return "asd"; } } @@ -36,7 +36,7 @@ try { } class MySplObjectStorage3 extends SplObjectStorage { - public function getHash($obj) { + public function getHash($obj): string { return "asd"; } } diff --git a/ext/spl/tests/arrayObject___construct_error2.phpt b/ext/spl/tests/arrayObject___construct_error2.phpt index 7850a453b4340..5ec297a1a6a97 100644 --- a/ext/spl/tests/arrayObject___construct_error2.phpt +++ b/ext/spl/tests/arrayObject___construct_error2.phpt @@ -4,11 +4,11 @@ SPL: ArrayObject::__construct with too many arguments. count(), $ao->count()); ==ArrayIterator== id = $other->getId(); } - public function accept() + public function accept(): bool { echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; return $this->current()->getId() == $this->id; diff --git a/ext/spl/tests/array_009a.phpt b/ext/spl/tests/array_009a.phpt index 451c22b565e32..906c562a3f601 100644 --- a/ext/spl/tests/array_009a.phpt +++ b/ext/spl/tests/array_009a.phpt @@ -5,12 +5,12 @@ SPL: ArrayIterator implementing RecursiveIterator class MyRecursiveArrayIterator extends ArrayIterator implements RecursiveIterator { - function hasChildren() + function hasChildren(): bool { return is_array($this->current()); } - function getChildren() + function getChildren(): RecursiveIterator { return new MyRecursiveArrayIterator($this->current()); } diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/array_017.phpt index 1165133b35022..fb152543d7e2f 100644 --- a/ext/spl/tests/array_017.phpt +++ b/ext/spl/tests/array_017.phpt @@ -24,7 +24,7 @@ class ArrayIteratorEx extends ArrayIterator ,'$this'=>$this)); } - function setFlags($flags) + function setFlags($flags): void { echo __METHOD__ . "($flags)\n"; ArrayIterator::setFlags($flags); @@ -67,13 +67,13 @@ class ArrayObjectEx extends ArrayObject } } - function setFlags($flags) + function setFlags($flags): void { echo __METHOD__ . "($flags)\n"; ArrayObject::setFlags($flags); } - function getIterator() + function getIterator(): Iterator { echo __METHOD__ . "()\n"; $it = new ArrayIteratorEx($this, $this->getFlags()); diff --git a/ext/spl/tests/array_019.phpt b/ext/spl/tests/array_019.phpt index 7d1239c0bdc4f..867ede8d2c38d 100644 --- a/ext/spl/tests/array_019.phpt +++ b/ext/spl/tests/array_019.phpt @@ -9,7 +9,7 @@ $ar = new RecursiveArrayIterator(array(3)); foreach($ar as &$v) var_dump($v); class ArrayIteratorEx extends ArrayIterator { - function current() + function current(): mixed { return ArrayIterator::current(); } diff --git a/ext/spl/tests/array_020.phpt b/ext/spl/tests/array_020.phpt index fa96f92ab3300..61733b82c06d4 100644 --- a/ext/spl/tests/array_020.phpt +++ b/ext/spl/tests/array_020.phpt @@ -5,34 +5,34 @@ SPL: ArrayIterator overloading class ArrayIteratorEx extends ArrayIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; ArrayIterator::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return ArrayIterator::valid(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return ArrayIterator::key(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return ArrayIterator::current(); } - function next() + function next(): void { echo __METHOD__ . "\n"; - return ArrayIterator::next(); + ArrayIterator::next(); } } diff --git a/ext/spl/tests/array_021.phpt b/ext/spl/tests/array_021.phpt index 620347dcd7b7d..3797471c6ff12 100644 --- a/ext/spl/tests/array_021.phpt +++ b/ext/spl/tests/array_021.phpt @@ -5,7 +5,7 @@ SPL: ArrayObject::seek() and exceptions class foo extends ArrayObject { - public function seek($key) + public function seek($key): void { echo __METHOD__ . "($key)\n"; throw new Exception("hi"); diff --git a/ext/spl/tests/array_024.phpt b/ext/spl/tests/array_024.phpt index 6223b8072eec5..3c4621be107bb 100644 --- a/ext/spl/tests/array_024.phpt +++ b/ext/spl/tests/array_024.phpt @@ -5,7 +5,7 @@ SPL: ArrayObject with overridden count() $obj = new ArrayObject(array(1,2)); var_dump(count($obj)); class ArrayObject2 extends ArrayObject { - public function count() { + public function count(): int { return -parent::count(); } } diff --git a/ext/spl/tests/bug31185.phpt b/ext/spl/tests/bug31185.phpt index 88cb3dbf7ca5c..70ae1c00983d5 100644 --- a/ext/spl/tests/bug31185.phpt +++ b/ext/spl/tests/bug31185.phpt @@ -6,20 +6,20 @@ Bug #31185 (Crash when exceptions thrown from ArrayAccess::offsetUnset()) class FooBar implements ArrayAccess { private $array = array(); - public function offsetExists($index) { + public function offsetExists($index): bool { return isset($this->array[$index]); } - public function offsetGet($index) { + public function offsetGet($index): mixed { return $this->array[$index]; } - public function offsetSet($index, $value) { + public function offsetSet($index, $value): void { echo __METHOD__ . "($index, $value)\n"; $this->array[$index] = $value; } - public function offsetUnset($index) { + public function offsetUnset($index): void { throw new Exception('FAIL'); unset($this->array[$index]); } diff --git a/ext/spl/tests/bug32134.phpt b/ext/spl/tests/bug32134.phpt index a81924ed1d29e..a516532c46b86 100644 --- a/ext/spl/tests/bug32134.phpt +++ b/ext/spl/tests/bug32134.phpt @@ -11,7 +11,7 @@ class myArray extends ArrayIterator parent::__construct($array); } - public function offsetGet($index) + public function offsetGet($index): mixed { static $i = 0; echo __METHOD__ . "($index)\n"; @@ -19,10 +19,10 @@ class myArray extends ArrayIterator return parent::offsetGet($index); } - public function offsetSet($index, $newval) + public function offsetSet($index, $newval): void { echo __METHOD__ . "($index,$newval)\n"; - return parent::offsetSet($index, $newval); + parent::offsetSet($index, $newval); } } diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt index 8b52eae5998de..35122909031f2 100644 --- a/ext/spl/tests/bug33136.phpt +++ b/ext/spl/tests/bug33136.phpt @@ -13,13 +13,13 @@ class Collection extends ArrayObject parent::__construct($this->data); } - function offsetGet($index) + function offsetGet($index): mixed { echo __METHOD__ . "($index)\n"; return parent::offsetGet($index); } - function offsetSet($index, $value) + function offsetSet($index, $value): void { echo __METHOD__ . "(" . (is_null($index) ? "NULL" : $index) . ",$value)\n"; parent::offsetSet($index, $value); diff --git a/ext/spl/tests/bug34548.phpt b/ext/spl/tests/bug34548.phpt index 4615b1306bd8a..5f3e00c7f3a19 100644 --- a/ext/spl/tests/bug34548.phpt +++ b/ext/spl/tests/bug34548.phpt @@ -10,7 +10,7 @@ class Collection extends ArrayObject foreach($dataArray as $value) $this->append($value); } - public function offsetSet($index, $value) + public function offsetSet($index, $value): void { parent::offsetSet($index, $value); } diff --git a/ext/spl/tests/bug36825.phpt b/ext/spl/tests/bug36825.phpt index 072009cf8424c..adbe0aff83a5e 100644 --- a/ext/spl/tests/bug36825.phpt +++ b/ext/spl/tests/bug36825.phpt @@ -5,7 +5,7 @@ Bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault) class foo extends ArrayObject { - public function offsetGet($key) + public function offsetGet($key): mixed { echo __METHOD__ . "($key)\n"; throw new Exception("hi"); diff --git a/ext/spl/tests/bug37457.phpt b/ext/spl/tests/bug37457.phpt index 792d5ae2a7a32..e8c7d7b9afca8 100644 --- a/ext/spl/tests/bug37457.phpt +++ b/ext/spl/tests/bug37457.phpt @@ -13,31 +13,31 @@ class Collection implements Iterator $this->array = $a; } - public function current() + public function current(): mixed { echo __METHOD__ . "\n"; return current($this->array); } - public function key() + public function key(): mixed { echo __METHOD__ . "\n"; return key($this->array); } - public function next() + public function next(): void { echo __METHOD__ . "\n"; $this->valid = (false !== next($this->array)); } - public function valid() + public function valid(): bool { echo __METHOD__ . "\n"; return $this->valid; } - public function rewind() + public function rewind(): void { echo __METHOD__ . "\n"; $this->valid = (false !== reset($this->array)); @@ -46,7 +46,7 @@ class Collection implements Iterator class TestFilter extends FilterIterator { - public function accept() + public function accept(): bool { echo __METHOD__ . "\n"; throw new Exception("Failure in Accept"); diff --git a/ext/spl/tests/bug42703.phpt b/ext/spl/tests/bug42703.phpt index b54425c3100df..668451f37a247 100644 --- a/ext/spl/tests/bug42703.phpt +++ b/ext/spl/tests/bug42703.phpt @@ -4,20 +4,20 @@ Bug #42703 (Exception raised in an iterator::current() causes segfault in Filter parent; } - /** - * @return Node - */ - public function current() + public function current(): Node { return $this->children[$this->index]; } - /** - * @return scalar - */ - public function key() + public function key(): int { return $this->index; } - /** - * @return void - */ - public function next() + public function next(): void { ++$this->index; } - /** - * @return void - */ - public function rewind() + public function rewind(): void { $this->index = 0; } - /** - * @return bool - */ - public function valid() + public function valid(): bool { return array_key_exists($this->index, $this->children); } - /** - * @return int - */ - public function count() + public function count(): int { return count($this->children); } - /** - * @return bool - */ - public function hasChildren() + public function hasChildren(): bool { return !empty($this->children); } - /** - * @return \RecursiveArrayIterator - */ - public function getChildren() + public function getChildren(): RecursiveArrayIterator { return new \RecursiveArrayIterator($this->children); } diff --git a/ext/spl/tests/bug66405.phpt b/ext/spl/tests/bug66405.phpt index b34e7b5074bc4..9fe137800ae75 100644 --- a/ext/spl/tests/bug66405.phpt +++ b/ext/spl/tests/bug66405.phpt @@ -13,14 +13,14 @@ touch($td . '/testsubdir/file3.csv'); class Bug66405 extends RecursiveDirectoryIterator { - public function current() + public function current(): mixed { $current = parent::current(); echo gettype($current) . " $current\n"; return $current; } - public function getChildren() + public function getChildren(): RecursiveDirectoryIterator { $children = parent::getChildren(); if (is_object($children)) { diff --git a/ext/spl/tests/bug66834.phpt b/ext/spl/tests/bug66834.phpt index c47a7f626369b..864ac3725c29e 100644 --- a/ext/spl/tests/bug66834.phpt +++ b/ext/spl/tests/bug66834.phpt @@ -6,12 +6,12 @@ SPL: Bug #66834 // overrides both offsetExists and offsetGet class ArrayObjectBoth extends ArrayObject { - public function offsetExists($offset) { + public function offsetExists($offset): bool { var_dump('Called: '.__METHOD__); return parent::offsetExists($offset); } - public function offsetGet($offset) { + public function offsetGet($offset): mixed { var_dump('Called: '.__METHOD__); return parent::offsetGet($offset); } @@ -20,7 +20,7 @@ class ArrayObjectBoth extends ArrayObject // overrides only offsetExists class ArrayObjectExists extends ArrayObject { - public function offsetExists($offset) { + public function offsetExists($offset): bool { var_dump('Called: '.__METHOD__); return parent::offsetExists($offset); } @@ -29,7 +29,7 @@ class ArrayObjectExists extends ArrayObject // overrides only offsetGet class ArrayObjectGet extends ArrayObject { - public function offsetGet($offset) { + public function offsetGet($offset): mixed { var_dump('Called: '.__METHOD__); return parent::offsetGet($offset); } @@ -38,14 +38,14 @@ class ArrayObjectGet extends ArrayObject // overrides only offsetGet and offsetSet class ArrayObjectGetSet extends ArrayObject { - public function offsetGet($offset) + public function offsetGet($offset): mixed { return parent::offsetGet(str_rot13($offset)); } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { - return parent::offsetSet(str_rot13($offset), $value); + parent::offsetSet(str_rot13($offset), $value); } } diff --git a/ext/spl/tests/bug67582.phpt b/ext/spl/tests/bug67582.phpt index 331accbe7e72e..dc0cd532321e3 100644 --- a/ext/spl/tests/bug67582.phpt +++ b/ext/spl/tests/bug67582.phpt @@ -5,7 +5,7 @@ Bug #67582: Cloned SplObjectStorage with overwritten getHash fails offsetExists( class MyObjectStorage extends SplObjectStorage { // Overwrite getHash() with just some (working) test-method - public function getHash($object) { return get_class($object); } + public function getHash($object): string { return get_class($object); } } class TestObject {} diff --git a/ext/spl/tests/bug69264.phpt b/ext/spl/tests/bug69264.phpt index 2f5251d1770ad..7e274c89f7519 100644 --- a/ext/spl/tests/bug69264.phpt +++ b/ext/spl/tests/bug69264.phpt @@ -3,49 +3,49 @@ Bug #69264 (__debugInfo() ignored while extending SPL classes) --FILE-- 42, 'parent' => count(parent::__debugInfo())]; } } class MyDoublyLinkedList extends SplDoublyLinkedList { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyObjectStorage extends SplObjectStorage { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyMultipleIterator extends MultipleIterator { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyArrayObject extends ArrayObject { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyArrayIterator extends ArrayIterator { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyMaxHeap extends SplMaxHeap { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } class MyPriorityQueue extends SplPriorityQueue { - public function __debugInfo() { + public function __debugInfo(): array { return ['child' => 42, 'parent' => count(parent::__debugInfo())]; } } diff --git a/ext/spl/tests/bug69737.phpt b/ext/spl/tests/bug69737.phpt index 02815c296a665..c3d4de78cb587 100644 --- a/ext/spl/tests/bug69737.phpt +++ b/ext/spl/tests/bug69737.phpt @@ -3,7 +3,7 @@ Bug #69737 (Segfault when SplMinHeap::compare produces fatal error) --FILE-- foo = 'bar'; } - public function serialize() + public function serialize(): string { unset($this->foo); $result = parent::serialize(); diff --git a/ext/spl/tests/bug74058.phpt b/ext/spl/tests/bug74058.phpt index a416d8f15ae00..32c57153ec100 100644 --- a/ext/spl/tests/bug74058.phpt +++ b/ext/spl/tests/bug74058.phpt @@ -10,13 +10,13 @@ class MyArrayObject extends ArrayObject parent::__construct($input, ArrayObject::ARRAY_AS_PROPS); } - public function offsetSet($x, $v) + public function offsetSet($x, $v): void { echo "offsetSet('{$x}')\n"; - return parent::offsetSet($x, $v); + parent::offsetSet($x, $v); } - public function offsetGet($x) + public function offsetGet($x): mixed { echo "offsetGet('{$x}')\n"; return parent::offsetGet($x); @@ -30,13 +30,13 @@ class MyArray extends ArrayObject parent::__construct($input); } - public function offsetSet($x, $v) + public function offsetSet($x, $v): void { echo "offsetSet('{$x}')\n"; - return parent::offsetSet($x, $v); + parent::offsetSet($x, $v); } - public function offsetGet($x) + public function offsetGet($x): mixed { echo "offsetGet('{$x}')\n"; return parent::offsetGet($x); diff --git a/ext/spl/tests/bug74478.phpt b/ext/spl/tests/bug74478.phpt index 3609db53ee1ef..c491b666f5dcc 100644 --- a/ext/spl/tests/bug74478.phpt +++ b/ext/spl/tests/bug74478.phpt @@ -5,24 +5,24 @@ Bug #74478: null coalescing operator failing with SplFixedArray class MyFixedArray extends \SplFixedArray { - public function offsetExists($name) { + public function offsetExists($name): bool { echo "offsetExists($name)\n"; return parent::offsetExists($name); } - public function offsetGet($name) { + public function offsetGet($name): mixed { echo "offsetGet($name)\n"; return parent::offsetGet($name); } - public function offsetSet($name, $value) { + public function offsetSet($name, $value): void { echo "offsetSet($name)\n"; - return parent::offsetSet($name, $value); + parent::offsetSet($name, $value); } - public function offsetUnset($name) { + public function offsetUnset($name): void { echo "offsetUnset($name)\n"; - return parent::offsetUnset($name); + parent::offsetUnset($name); } -}; +} $fixedData = new MyFixedArray(10); var_dump(isset($fixedData[0][1][2])); diff --git a/ext/spl/tests/bug74669.phpt b/ext/spl/tests/bug74669.phpt index 98e9c8867229c..0966a4cf27e15 100644 --- a/ext/spl/tests/bug74669.phpt +++ b/ext/spl/tests/bug74669.phpt @@ -19,27 +19,27 @@ class Container implements Iterator $this->container->append($element); } - public function current() + public function current(): mixed { return $this->iterator->current(); } - public function next() + public function next(): void { $this->iterator->next(); } - public function key() + public function key(): mixed { return $this->iterator->key(); } - public function valid() + public function valid(): bool { return $this->iterator->valid(); } - public function rewind() + public function rewind(): void { $this->iterator->rewind(); } diff --git a/ext/spl/tests/bug77263.phpt b/ext/spl/tests/bug77263.phpt index ddd5fba3cd499..386744793a9cb 100644 --- a/ext/spl/tests/bug77263.phpt +++ b/ext/spl/tests/bug77263.phpt @@ -9,11 +9,11 @@ touch("$dir/file1"); touch("$dir/subdir/file2"); class Filter1 extends RecursiveFilterIterator { - public function accept() { return $this->getInnerIterator()->getSubPathname() != ''; } + public function accept(): bool { return $this->getInnerIterator()->getSubPathname() != ''; } } class Filter2 extends RecursiveFilterIterator { - public function accept() { return $this->getInnerIterator()->getSubPathname() != ' '; } + public function accept(): bool { return $this->getInnerIterator()->getSubPathname() != ' '; } } $iterator = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS ); diff --git a/ext/spl/tests/dllist_008.phpt b/ext/spl/tests/dllist_008.phpt index 114b50c4f5c28..5daaa59e15183 100644 --- a/ext/spl/tests/dllist_008.phpt +++ b/ext/spl/tests/dllist_008.phpt @@ -7,7 +7,7 @@ $obj[] = 1; $obj[] = 2; var_dump(count($obj)); class SplDoublyLinkedList2 extends SplDoublyLinkedList{ - public function count() { + public function count(): int { return -parent::count(); } } diff --git a/ext/spl/tests/fixedarray_002.phpt b/ext/spl/tests/fixedarray_002.phpt index f111dd1bfc0fa..8737dffc057b3 100644 --- a/ext/spl/tests/fixedarray_002.phpt +++ b/ext/spl/tests/fixedarray_002.phpt @@ -6,23 +6,23 @@ class A extends SplFixedArray { public $prop1 = NULL; public $prop2 = NULL; - public function count() { + public function count(): int { return 2; } - public function offsetGet($n) { + public function offsetGet($n): mixed { echo "A::offsetGet\n"; return parent::offsetGet($n); } - public function offsetSet($n, $v) { + public function offsetSet($n, $v): void { echo "A::offsetSet\n"; - return parent::offsetSet($n, $v); + parent::offsetSet($n, $v); } - public function offsetUnset($n) { + public function offsetUnset($n): void { echo "A::offsetUnset\n"; - return parent::offsetUnset($n); + parent::offsetUnset($n); } - public function offsetExists($n) { + public function offsetExists($n): bool { echo "A::offsetExists\n"; return parent::offsetExists($n); } diff --git a/ext/spl/tests/fixedarray_018.phpt b/ext/spl/tests/fixedarray_018.phpt index aa02fb5de1509..4f5560785e57d 100644 --- a/ext/spl/tests/fixedarray_018.phpt +++ b/ext/spl/tests/fixedarray_018.phpt @@ -5,7 +5,7 @@ SPL: FixedArray: overridden count() $obj = new SplFixedArray(2); var_dump(count($obj)); class SplFixedArray2 extends SplFixedArray { - public function count() { + public function count(): int { return -parent::count(); } } diff --git a/ext/spl/tests/heap_003.phpt b/ext/spl/tests/heap_003.phpt index 69620af8efb7c..b864d373197e7 100644 --- a/ext/spl/tests/heap_003.phpt +++ b/ext/spl/tests/heap_003.phpt @@ -3,7 +3,7 @@ SPL: SplHeap: comparison callback --FILE-- $b) { $result = 1; } else if ($a < $b) { diff --git a/ext/spl/tests/heap_004.phpt b/ext/spl/tests/heap_004.phpt index 892da20fb70e2..3db18b6733839 100644 --- a/ext/spl/tests/heap_004.phpt +++ b/ext/spl/tests/heap_004.phpt @@ -3,7 +3,7 @@ SPL: SplHeap: exceptions --FILE-- insert(1); $obj->insert(2); var_dump(count($obj)); class SplMaxHeap2 extends SplMaxHeap{ - public function count() { + public function count(): int { return -parent::count(); } } diff --git a/ext/spl/tests/heap_011.phpt b/ext/spl/tests/heap_011.phpt index fae62585b0ebe..7413443cfce74 100644 --- a/ext/spl/tests/heap_011.phpt +++ b/ext/spl/tests/heap_011.phpt @@ -3,7 +3,7 @@ SPL: SplHeap with overridden compare() --FILE-- insert(2); var_dump($h->top()); class SplMaxHeap2 extends SplMaxHeap { - public function compare($a, $b) { + public function compare($a, $b): int { return -parent::compare($a,$b); } } diff --git a/ext/spl/tests/heap_corruption.phpt b/ext/spl/tests/heap_corruption.phpt index 9b14a0fe0b09e..149d0b671996d 100644 --- a/ext/spl/tests/heap_corruption.phpt +++ b/ext/spl/tests/heap_corruption.phpt @@ -10,7 +10,7 @@ class myHeap extends SplHeap { public $allow_compare = true; - public function compare($v1, $v2) + public function compare($v1, $v2): int { if ($this->allow_compare == true) { diff --git a/ext/spl/tests/heap_current_variation_001.phpt b/ext/spl/tests/heap_current_variation_001.phpt index a55bb486e95ac..be9dc7bc1691d 100644 --- a/ext/spl/tests/heap_current_variation_001.phpt +++ b/ext/spl/tests/heap_current_variation_001.phpt @@ -8,7 +8,7 @@ Mike Sullivan class myHeap extends SplHeap { - public function compare($v1, $v2) + public function compare($v1, $v2): int { throw new Exception(''); } diff --git a/ext/spl/tests/heap_top_variation_002.phpt b/ext/spl/tests/heap_top_variation_002.phpt index add363eab3121..0a9a8db613bed 100644 --- a/ext/spl/tests/heap_top_variation_002.phpt +++ b/ext/spl/tests/heap_top_variation_002.phpt @@ -7,7 +7,7 @@ TestFest London May 2009 a = $a; } - public function rewind() + public function rewind(): void { echo __METHOD__ . "\n"; $this->i = 0; } - public function valid() + public function valid(): bool { $ret = $this->i < count($this->a); echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; return $ret; } - public function key() + public function key(): mixed { echo __METHOD__ . "\n"; return $this->i; } - public function current() + public function current(): mixed { echo __METHOD__ . "\n"; return $this->a[$this->i]; } - public function next() + public function next(): void { echo __METHOD__ . "\n"; $this->i++; @@ -54,7 +54,7 @@ class NumericArrayIterator implements Iterator class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator { - public function seek($index) + public function seek($index): void { if ($index < count($this->a)) { $this->i = $index; diff --git a/ext/spl/tests/iterator_002.phpt b/ext/spl/tests/iterator_002.phpt index da790988fcbe9..b30f9285dc0b3 100644 --- a/ext/spl/tests/iterator_002.phpt +++ b/ext/spl/tests/iterator_002.phpt @@ -3,40 +3,40 @@ SPL: Iterator using getInnerIterator --FILE-- current()); } - function getChildren() + function getChildren(): MyRecursiveArrayIterator { - return new RecursiceArrayIterator($this->current()); + return new MyRecursiveArrayIterator($this->current()); } } class CrashIterator extends FilterIterator implements RecursiveIterator { - function accept() + function accept(): bool { return true; } - function hasChildren() + function hasChildren(): bool { return $this->getInnerIterator()->hasChildren(); } - function getChildren() + function getChildren(): MyRecursiveArrayIterator { - return new RecursiceArrayIterator($this->getInnerIterator()->current()); + return new MyRecursiveArrayIterator($this->getInnerIterator()->current()); } } $array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); -$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY); +$dir = new RecursiveIteratorIterator(new CrashIterator(new MyRecursiveArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($dir as $file) { print "$file\n"; diff --git a/ext/spl/tests/iterator_003.phpt b/ext/spl/tests/iterator_003.phpt index b7b331a496d5a..dfb44b94f9b5d 100644 --- a/ext/spl/tests/iterator_003.phpt +++ b/ext/spl/tests/iterator_003.phpt @@ -35,7 +35,7 @@ class StudentIdFilter extends FilterIterator $this->id = $other->getId(); } - public function accept() + public function accept(): bool { echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; return $this->current()->getId() == $this->id; diff --git a/ext/spl/tests/iterator_004.phpt b/ext/spl/tests/iterator_004.phpt index d131593ad205c..bc23ed35475c5 100644 --- a/ext/spl/tests/iterator_004.phpt +++ b/ext/spl/tests/iterator_004.phpt @@ -14,32 +14,32 @@ class NumericArrayIterator implements Iterator $this->a = $a; } - public function rewind() + public function rewind(): void { echo __METHOD__ . "\n"; $this->i = 0; } - public function valid() + public function valid(): bool { $ret = $this->i < count($this->a); echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; return $ret; } - public function key() + public function key(): mixed { echo __METHOD__ . "\n"; return $this->i; } - public function current() + public function current(): mixed { echo __METHOD__ . "\n"; return $this->a[$this->i]; } - public function next() + public function next(): void { echo __METHOD__ . "\n"; $this->i++; @@ -48,7 +48,7 @@ class NumericArrayIterator implements Iterator class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator { - public function seek($index) + public function seek($index): void { if ($index < count($this->a)) { $this->i = $index; diff --git a/ext/spl/tests/iterator_005.phpt b/ext/spl/tests/iterator_005.phpt index 9f13889a18581..07584c14f9a4b 100644 --- a/ext/spl/tests/iterator_005.phpt +++ b/ext/spl/tests/iterator_005.phpt @@ -5,10 +5,10 @@ SPL: IteratorIterator and ArrayIterator/Object class ArrayIteratorEx extends ArrayIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; - return parent::rewind(); + parent::rewind(); } } @@ -21,7 +21,7 @@ foreach(new IteratorIterator($it) as $v) class ArrayObjectEx extends ArrayObject { - function getIterator() + function getIterator(): Iterator { echo __METHOD__ . "\n"; return parent::getIterator(); diff --git a/ext/spl/tests/iterator_007.phpt b/ext/spl/tests/iterator_007.phpt index 8fb503c79a7a3..672818a265797 100644 --- a/ext/spl/tests/iterator_007.phpt +++ b/ext/spl/tests/iterator_007.phpt @@ -5,27 +5,27 @@ SPL: NoRewindIterator class ArrayIteratorEx extends ArrayIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); @@ -34,27 +34,27 @@ class ArrayIteratorEx extends ArrayIterator class NoRewindIteratorEx extends NoRewindIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_008.phpt b/ext/spl/tests/iterator_008.phpt index 19c6038e3c4c5..875d190a8b323 100644 --- a/ext/spl/tests/iterator_008.phpt +++ b/ext/spl/tests/iterator_008.phpt @@ -5,27 +5,27 @@ SPL: InfiniteIterator class ArrayIteratorEx extends ArrayIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_009.phpt b/ext/spl/tests/iterator_009.phpt index 19447deac458e..9483f5ac999e3 100644 --- a/ext/spl/tests/iterator_009.phpt +++ b/ext/spl/tests/iterator_009.phpt @@ -5,27 +5,27 @@ SPL: EmptyIterator class EmptyIteratorEx extends EmptyIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_014.phpt b/ext/spl/tests/iterator_014.phpt index 363b2916fe9ce..097501f53bb64 100644 --- a/ext/spl/tests/iterator_014.phpt +++ b/ext/spl/tests/iterator_014.phpt @@ -5,7 +5,7 @@ SPL: RecursiveIteratorIterator and beginChildren/endChildren class MyRecursiveArrayIterator extends RecursiveArrayIterator { - function valid() + function valid(): bool { if (!parent::valid()) { @@ -18,7 +18,7 @@ class MyRecursiveArrayIterator extends RecursiveArrayIterator } } - function getChildren() + function getChildren(): RecursiveArrayIterator { echo __METHOD__ . "\n"; return parent::getChildren(); @@ -27,31 +27,31 @@ class MyRecursiveArrayIterator extends RecursiveArrayIterator class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_015.phpt b/ext/spl/tests/iterator_015.phpt index f83366bb1c43d..fa103bc738e26 100644 --- a/ext/spl/tests/iterator_015.phpt +++ b/ext/spl/tests/iterator_015.phpt @@ -5,7 +5,7 @@ SPL: RecursiveIteratorIterator and beginChildren/endChildren class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator { - function rewind() + function rewind(): void { echo "
    \n"; parent::rewind(); @@ -19,7 +19,7 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator { echo str_repeat(' ',$this->getDepth())."
\n"; } - function valid() + function valid(): bool { if (!parent::valid()) { echo "
    \n"; diff --git a/ext/spl/tests/iterator_016.phpt b/ext/spl/tests/iterator_016.phpt index 966c05d989c85..1bee2d3a8b0d8 100644 --- a/ext/spl/tests/iterator_016.phpt +++ b/ext/spl/tests/iterator_016.phpt @@ -5,7 +5,7 @@ SPL: RecursiveIteratorIterator and beginChildren/endChildren class Menu extends ArrayObject { - function getIterator() + function getIterator(): Iterator { echo __METHOD__ . "\n"; return new RecursiveArrayIterator($this); @@ -18,7 +18,7 @@ class MenuOutput extends RecursiveIteratorIterator { parent::__construct($it); } - function rewind() + function rewind(): void { echo "
      \n"; parent::rewind(); @@ -32,7 +32,7 @@ class MenuOutput extends RecursiveIteratorIterator { echo str_repeat(' ',$this->getDepth())."
    \n"; } - function valid() + function valid(): bool { if (!parent::valid()) { echo "
      \n"; diff --git a/ext/spl/tests/iterator_021.phpt b/ext/spl/tests/iterator_021.phpt index 433ced95e75ff..d297888467e84 100644 --- a/ext/spl/tests/iterator_021.phpt +++ b/ext/spl/tests/iterator_021.phpt @@ -5,7 +5,7 @@ SPL: RecursiveIteratorIterator and hasChildren class MyRecursiveArrayIterator extends RecursiveArrayIterator { - function valid() + function valid(): bool { if (!parent::valid()) { @@ -18,7 +18,7 @@ class MyRecursiveArrayIterator extends RecursiveArrayIterator } } - function getChildren() + function getChildren(): ?RecursiveArrayIterator { echo __METHOD__ . "\n"; return parent::getChildren(); @@ -37,14 +37,14 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator parent::__construct($it); } - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; $this->skip = false; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; if ($this->skip) @@ -55,19 +55,19 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_022.phpt b/ext/spl/tests/iterator_022.phpt index ae79932828427..40ef426656c2d 100644 --- a/ext/spl/tests/iterator_022.phpt +++ b/ext/spl/tests/iterator_022.phpt @@ -5,13 +5,13 @@ SPL: RecursiveIteratorIterator and callHasChildren/callGetChildren class MyRecursiveArrayIterator extends RecursiveArrayIterator { - function getChildren() + function getChildren(): RecursiveArrayIterator { echo __METHOD__ . "\n"; return $this->current(); } - function valid() + function valid(): bool { if (!parent::valid()) { @@ -37,14 +37,14 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator parent::__construct($it); } - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; $this->skip = false; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; if ($this->skip) @@ -55,19 +55,19 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_023.phpt b/ext/spl/tests/iterator_023.phpt index b75b2bcb7a407..5e3aa988470c9 100644 --- a/ext/spl/tests/iterator_023.phpt +++ b/ext/spl/tests/iterator_023.phpt @@ -5,13 +5,13 @@ SPL: RecursiveIteratorIterator and catch getChildren class MyRecursiveArrayIterator extends RecursiveArrayIterator { - function getChildren() + function getChildren(): RecursiveArrayIterator { echo __METHOD__ . "\n"; return $this->current(); } - function valid() + function valid(): bool { if (!parent::valid()) { @@ -37,14 +37,14 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator parent::__construct($it, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); } - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; $this->skip = false; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; if ($this->skip) @@ -55,19 +55,19 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "\n"; parent::next(); diff --git a/ext/spl/tests/iterator_031.phpt b/ext/spl/tests/iterator_031.phpt index d1aed21ac0692..48c3a9dce6c7a 100644 --- a/ext/spl/tests/iterator_031.phpt +++ b/ext/spl/tests/iterator_031.phpt @@ -5,7 +5,7 @@ SPL: AppendIterator::append() rewinds when necessary class MyArrayIterator extends ArrayIterator { - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); @@ -26,13 +26,13 @@ class MyAppendIterator extends AppendIterator echo __METHOD__ . "\n"; } - function rewind() + function rewind(): void { echo __METHOD__ . "\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "\n"; return parent::valid(); diff --git a/ext/spl/tests/iterator_034.phpt b/ext/spl/tests/iterator_034.phpt index 76cc9589ce75c..aeff9140856c3 100644 --- a/ext/spl/tests/iterator_034.phpt +++ b/ext/spl/tests/iterator_034.phpt @@ -5,7 +5,7 @@ SPL: RecursiveIteratorIterator and break deep class MyRecursiveArrayIterator extends RecursiveArrayIterator { - function valid() + function valid(): bool { if (!parent::valid()) { @@ -18,13 +18,13 @@ class MyRecursiveArrayIterator extends RecursiveArrayIterator } } - function getChildren() + function getChildren(): RecursiveArrayIterator { echo __METHOD__ . "()\n"; return parent::getChildren(); } - function rewind() + function rewind(): void { echo __METHOD__ . "()\n"; parent::rewind(); @@ -42,32 +42,32 @@ class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator parent::__construct($it); } - function rewind() + function rewind(): void { echo __METHOD__ . "() - BEGIN\n"; parent::rewind(); echo __METHOD__ . "() - DONE\n"; } - function valid() + function valid(): bool { echo __METHOD__ . "()\n"; return parent::valid(); } - function current() + function current(): mixed { echo __METHOD__ . "()\n"; return parent::current(); } - function key() + function key(): mixed { echo __METHOD__ . "()\n"; return parent::key(); } - function next() + function next(): void { echo __METHOD__ . "()\n"; parent::next(); diff --git a/ext/spl/tests/iterator_039.phpt b/ext/spl/tests/iterator_039.phpt index 18f9a24168fa2..32ddc077e2216 100644 --- a/ext/spl/tests/iterator_039.phpt +++ b/ext/spl/tests/iterator_039.phpt @@ -14,31 +14,31 @@ class NumericArrayIterator implements Iterator $this->a = $a; } - public function valid() + public function valid(): bool { echo __METHOD__ . "\n"; return $this->i < count($this->a); } - public function rewind() + public function rewind(): void { echo __METHOD__ . "\n"; $this->i = 0; } - public function key() + public function key(): mixed { echo __METHOD__ . "\n"; return $this->i; } - public function current() + public function current(): mixed { echo __METHOD__ . "\n"; return $this->a[$this->i]; } - public function next() + public function next(): void { echo __METHOD__ . "\n"; $this->i++; diff --git a/ext/spl/tests/iterator_040.phpt b/ext/spl/tests/iterator_040.phpt index 1e8bd55764545..834276d45733e 100644 --- a/ext/spl/tests/iterator_040.phpt +++ b/ext/spl/tests/iterator_040.phpt @@ -5,7 +5,7 @@ SPL: RecursiveFilterIterator class MyRecursiveFilterIterator extends RecursiveFilterIterator { - function accept() + function accept(): bool { return true; } diff --git a/ext/spl/tests/iterator_041.phpt b/ext/spl/tests/iterator_041.phpt index 98892c87e0d79..9431789c2e04c 100644 --- a/ext/spl/tests/iterator_041.phpt +++ b/ext/spl/tests/iterator_041.phpt @@ -24,34 +24,34 @@ class MyArrayIterator extends ArrayIterator self::fail(1, __FUNCTION__); } - function rewind() + function rewind(): void { self::fail(2, __FUNCTION__); - return parent::rewind(); + parent::rewind(); } - function valid() + function valid(): bool { self::fail(3, __FUNCTION__); return parent::valid(); } - function current() + function current(): mixed { self::fail(4, __FUNCTION__); return parent::current(); } - function key() + function key(): mixed { self::fail(5, __FUNCTION__); return parent::key(); } - function next() + function next(): void { self::fail(6, __FUNCTION__); - return parent::next(); + parent::next(); } function __destruct() diff --git a/ext/spl/tests/iterator_041a.phpt b/ext/spl/tests/iterator_041a.phpt index 37b4341297c50..9dd357adc0a4c 100644 --- a/ext/spl/tests/iterator_041a.phpt +++ b/ext/spl/tests/iterator_041a.phpt @@ -24,34 +24,34 @@ class MyArrayIterator extends ArrayIterator self::fail(1, __FUNCTION__); } - function rewind() + function rewind(): void { self::fail(2, __FUNCTION__); - return parent::rewind(); + parent::rewind(); } - function valid() + function valid(): bool { self::fail(3, __FUNCTION__); return parent::valid(); } - function current() + function current(): mixed { self::fail(4, __FUNCTION__); return parent::current(); } - function key() + function key(): mixed { self::fail(5, __FUNCTION__); return parent::key(); } - function next() + function next(): void { self::fail(6, __FUNCTION__); - return parent::next(); + parent::next(); } function __destruct() diff --git a/ext/spl/tests/iterator_041b.phpt b/ext/spl/tests/iterator_041b.phpt index 517b8fc5e46bb..723677dc30f47 100644 --- a/ext/spl/tests/iterator_041b.phpt +++ b/ext/spl/tests/iterator_041b.phpt @@ -24,34 +24,34 @@ class MyArrayIterator extends ArrayIterator self::fail(1, __FUNCTION__); } - function rewind() + function rewind(): void { self::fail(2, __FUNCTION__); - return parent::rewind(); + parent::rewind(); } - function valid() + function valid(): bool { self::fail(3, __FUNCTION__); return parent::valid(); } - function current() + function current(): mixed { self::fail(4, __FUNCTION__); return parent::current(); } - function key() + function key(): mixed { self::fail(5, __FUNCTION__); return parent::key(); } - function next() + function next(): void { self::fail(6, __FUNCTION__); - return parent::next(); + parent::next(); } function __destruct() diff --git a/ext/spl/tests/iterator_047.phpt b/ext/spl/tests/iterator_047.phpt index 9d7586bf4e24b..796a08bfde6eb 100644 --- a/ext/spl/tests/iterator_047.phpt +++ b/ext/spl/tests/iterator_047.phpt @@ -15,14 +15,14 @@ class MyRecursiveArrayIterator extends RecursiveArrayIterator } } - function hasChildren() + function hasChildren(): bool { echo __METHOD__ . "()\n"; self::fail(1, __METHOD__); return parent::hasChildren(); } - function getChildren() + function getChildren(): RecursiveArrayIterator { echo __METHOD__ . "()\n"; self::fail(2, __METHOD__); diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt index e73d40203d539..07b12601d1327 100644 --- a/ext/spl/tests/iterator_052.phpt +++ b/ext/spl/tests/iterator_052.phpt @@ -23,7 +23,7 @@ class MyRegexIterator extends RegexIterator } } - function accept() + function accept(): bool { @preg_match_all($this->re, (string)($this->uk ? $this->key() : $this->current()), $sub); $ret = parent::accept(); diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt index ac8f438a04611..64898624ce421 100644 --- a/ext/spl/tests/iterator_053.phpt +++ b/ext/spl/tests/iterator_053.phpt @@ -23,7 +23,7 @@ class MyRegexIterator extends RegexIterator } } - function accept() + function accept(): bool { @preg_match_all($this->re, (string)($this->uk ? $this->key() : $this->current()), $sub); $ret = parent::accept(); diff --git a/ext/spl/tests/iterator_056.phpt b/ext/spl/tests/iterator_056.phpt index 54a31d18baf49..84427b8707dcc 100644 --- a/ext/spl/tests/iterator_056.phpt +++ b/ext/spl/tests/iterator_056.phpt @@ -6,7 +6,7 @@ Sebastian Schürmann name = '$' . $name; } - function update(SplSubject $subject) + function update(SplSubject $subject): void { echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n"; } @@ -33,7 +33,7 @@ class SubjectImpl implements SplSubject $this->name = '$' . $name; } - function attach(SplObserver $observer) + function attach(SplObserver $observer): void { echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n"; if (!in_array($observer, $this->observers)) @@ -42,7 +42,7 @@ class SubjectImpl implements SplSubject } } - function detach(SplObserver $observer) + function detach(SplObserver $observer): void { echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n"; $idx = array_search($observer, $this->observers); @@ -52,7 +52,7 @@ class SubjectImpl implements SplSubject } } - function notify() + function notify(): void { echo '$sub->' . __METHOD__ . "();\n"; foreach($this->observers as $observer) diff --git a/ext/spl/tests/observer_002.phpt b/ext/spl/tests/observer_002.phpt index 2642c28bd57c7..74bf3d4b930b1 100644 --- a/ext/spl/tests/observer_002.phpt +++ b/ext/spl/tests/observer_002.phpt @@ -5,31 +5,31 @@ SPL: SplObjectStorage class MyObjectStorage extends SplObjectStorage { - function rewind() + function rewind(): void { echo __METHOD__ . "()\n"; parent::rewind(); } - function valid() + function valid(): bool { echo __METHOD__ . "(" . (parent::valid() ? 1 : 0) . ")\n"; return parent::valid(); } - function key() + function key(): int { echo __METHOD__ . "(" . parent::key() . ")\n"; return parent::key(); } - function current() + function current(): object { echo __METHOD__ . "(" . parent::current()->getName() . ")\n"; return parent::current(); } - function next() + function next(): void { echo __METHOD__ . "()\n"; parent::next(); @@ -45,7 +45,7 @@ class ObserverImpl implements SplObserver $this->name = '$' . $name; } - function update(SplSubject $subject) + function update(SplSubject $subject): void { echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n"; } @@ -67,24 +67,24 @@ class SubjectImpl implements SplSubject $this->name = '$' . $name; } - function attach(SplObserver $observer) + function attach(SplObserver $observer): void { echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n"; $this->observers->attach($observer); } - function detach(SplObserver $observer) + function detach(SplObserver $observer): void { echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n"; $this->observers->detach($observer); } - function count() + function count(): int { return $this->observers->count(); } - function notify() + function notify(): void { echo $this->name . '->' . __METHOD__ . "();\n"; foreach($this->observers as $key => $observer) diff --git a/ext/spl/tests/pqueue_002.phpt b/ext/spl/tests/pqueue_002.phpt index ee9a5f30caeff..df4a64f4b2d03 100644 --- a/ext/spl/tests/pqueue_002.phpt +++ b/ext/spl/tests/pqueue_002.phpt @@ -3,7 +3,7 @@ SPL: SplPriorityQueue: exceptions --FILE-- fail) throw new Exception('Corrupting heap',99); return 0; diff --git a/ext/spl/tests/spl_iterator_apply_error.phpt b/ext/spl/tests/spl_iterator_apply_error.phpt index c73fe468a1009..2a5caa008670d 100644 --- a/ext/spl/tests/spl_iterator_apply_error.phpt +++ b/ext/spl/tests/spl_iterator_apply_error.phpt @@ -4,7 +4,7 @@ SPL: Error: iterator_apply when an iterator method (eg rewind) throws exception = 3006011 -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_backup, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_backup, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, destination, SQLite3, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sourceDatabase, IS_STRING, 0, "\"main\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destinationDatabase, IS_STRING, 0, "\"main\"") ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_escapeString, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_escapeString, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_prepare, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3_prepare, 0, 1, SQLite3Stmt, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_SQLite3_exec arginfo_class_SQLite3_prepare +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_exec, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SQLite3_query arginfo_class_SQLite3_prepare +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3_query, 0, 1, SQLite3Result, MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_querySingle, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_querySingle, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, entireRow, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_createFunction, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createFunction, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, argCount, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_createAggregate, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createAggregate, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, stepCallback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, finalCallback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, argCount, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_createCollation, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createCollation, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() @@ -86,15 +97,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_openBlob, 0, 0, 3) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SQLITE3_OPEN_READONLY") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_enableExceptions, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_enableExceptions, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_enableExtendedResultCodes, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_enableExtendedResultCodes, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_setAuthorizer, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_setAuthorizer, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) ZEND_END_ARG_INFO() @@ -103,13 +114,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt_bindParam, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3Stmt_bindParam, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt_bindValue, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3Stmt_bindValue, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT") @@ -119,29 +130,33 @@ ZEND_END_ARG_INFO() #define arginfo_class_SQLite3Stmt_close arginfo_class_SQLite3_close -#define arginfo_class_SQLite3Stmt_execute arginfo_class_SQLite3_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3Stmt_execute, 0, 0, SQLite3Result, MAY_BE_FALSE) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt_getSQL, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Stmt_getSQL, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expand, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -#define arginfo_class_SQLite3Stmt_paramCount arginfo_class_SQLite3_close +#define arginfo_class_SQLite3Stmt_paramCount arginfo_class_SQLite3_lastInsertRowID #define arginfo_class_SQLite3Stmt_readOnly arginfo_class_SQLite3_close #define arginfo_class_SQLite3Stmt_reset arginfo_class_SQLite3_close -#define arginfo_class_SQLite3Result___construct arginfo_class_SQLite3_close +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Result___construct, 0, 0, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_SQLite3Result_numColumns arginfo_class_SQLite3_close +#define arginfo_class_SQLite3Result_numColumns arginfo_class_SQLite3_lastInsertRowID -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Result_columnName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_columnName, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_SQLite3Result_columnType arginfo_class_SQLite3Result_columnName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_columnType, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Result_fetchArray, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_fetchArray, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "SQLITE3_BOTH") ZEND_END_ARG_INFO() diff --git a/ext/standard/dir_arginfo.h b/ext/standard/dir_arginfo.h index 1ad629204c589..d2e10868e57d8 100644 --- a/ext/standard/dir_arginfo.h +++ b/ext/standard/dir_arginfo.h @@ -1,12 +1,13 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 1fd5cc5147c7272006e59d63d68c12caec84589f */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Directory_close, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Directory_close, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() #define arginfo_class_Directory_rewind arginfo_class_Directory_close -#define arginfo_class_Directory_read arginfo_class_Directory_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_Directory_read, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() ZEND_FUNCTION(closedir); diff --git a/ext/standard/tests/class_object/get_object_vars_variation_004.phpt b/ext/standard/tests/class_object/get_object_vars_variation_004.phpt index 902149ea0ac4c..677dee2b42ea0 100644 Binary files a/ext/standard/tests/class_object/get_object_vars_variation_004.phpt and b/ext/standard/tests/class_object/get_object_vars_variation_004.phpt differ diff --git a/ext/standard/tests/file/userfilters.phpt b/ext/standard/tests/file/userfilters.phpt index 40d1298fc4b44..35bc9c08b60e1 100644 --- a/ext/standard/tests/file/userfilters.phpt +++ b/ext/standard/tests/file/userfilters.phpt @@ -4,7 +4,7 @@ stream userfilter test data = strtoupper($bucket->data); $consumed += strlen($bucket->data); @@ -13,8 +13,9 @@ class testfilter extends php_user_filter { return PSFS_PASS_ON; } - function oncreate() { + function onCreate(): bool { echo "params: {$this->params}\n"; + return true; } } diff --git a/ext/standard/tests/filters/bug35916.phpt b/ext/standard/tests/filters/bug35916.phpt index e234949303fc4..4e2e8cc88ed94 100644 --- a/ext/standard/tests/filters/bug35916.phpt +++ b/ext/standard/tests/filters/bug35916.phpt @@ -7,7 +7,7 @@ $file = __DIR__ . "/bug35916.txt"; class strtoupper_filter extends php_user_filter { - function filter($in, $out, &$consumed, $closing) + function filter($in, $out, &$consumed, $closing): int { while($bucket=stream_bucket_make_writeable($in)) { $bucket->data = strtoupper($bucket->data); @@ -17,11 +17,13 @@ class strtoupper_filter extends php_user_filter } return PSFS_PASS_ON; } - function onCreate() + function onCreate(): bool { echo "fffffffffff\n"; + + return true; } - function onClose() + function onClose(): void { echo "hello\n"; } diff --git a/ext/standard/tests/filters/bug46164-1.phpt b/ext/standard/tests/filters/bug46164-1.phpt index ecdd86bbe2849..014708e513d64 100644 --- a/ext/standard/tests/filters/bug46164-1.phpt +++ b/ext/standard/tests/filters/bug46164-1.phpt @@ -3,7 +3,7 @@ Bug #46164 - 1 (stream_filter_remove() closes the stream) --FILE-- datalen; stream_bucket_append($out, $bucket); diff --git a/ext/standard/tests/filters/bug46164-2.phpt b/ext/standard/tests/filters/bug46164-2.phpt index c58295076f0b1..6cf6a968c75a3 100644 --- a/ext/standard/tests/filters/bug46164-2.phpt +++ b/ext/standard/tests/filters/bug46164-2.phpt @@ -3,7 +3,7 @@ Bug #46164 - 2 (stream_filter_remove() closes the stream) --FILE-- datalen; stream_bucket_append($out, $bucket); diff --git a/ext/standard/tests/filters/bug72941.phpt b/ext/standard/tests/filters/bug72941.phpt index 464b0050793c4..6e9752b843830 100644 --- a/ext/standard/tests/filters/bug72941.phpt +++ b/ext/standard/tests/filters/bug72941.phpt @@ -4,7 +4,7 @@ Bug #72941 (Modifying bucket->data by-ref has no effect any longer) rotate($bucket->data); diff --git a/ext/standard/tests/filters/bug73586.phpt b/ext/standard/tests/filters/bug73586.phpt index 3cae4662bff8b..8e6cb302f34e3 100644 --- a/ext/standard/tests/filters/bug73586.phpt +++ b/ext/standard/tests/filters/bug73586.phpt @@ -4,7 +4,7 @@ Bug #73586 (php_user_filter::$stream is not set to the stream the filter is work datalen; stream_bucket_append($out, $bucket); @@ -25,7 +25,7 @@ stream_copy_to_stream($fin, STDOUT); datalen; stream_bucket_append($out, $bucket); diff --git a/ext/standard/tests/filters/filter_errors_user.phpt b/ext/standard/tests/filters/filter_errors_user.phpt index a8547fe9ed7d3..5c9ddcc79b894 100644 --- a/ext/standard/tests/filters/filter_errors_user.phpt +++ b/ext/standard/tests/filters/filter_errors_user.phpt @@ -5,18 +5,18 @@ Filter errors: user filter require 'filter_errors.inc'; class test_filter0 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { + function filter($in, $out, &$consumed, $closing): int { return PSFS_ERR_FATAL; } } class test_filter1 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { + function filter($in, $out, &$consumed, $closing): int { $bucket = stream_bucket_make_writeable($in); return PSFS_ERR_FATAL; } } class test_filter2 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { + function filter($in, $out, &$consumed, $closing): int { while ($bucket = stream_bucket_make_writeable($in)) { $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); @@ -25,7 +25,7 @@ class test_filter2 extends php_user_filter { } } class test_filter3 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { + function filter($in, $out, &$consumed, $closing): int { if (!$closing) { $bucket = stream_bucket_new($this->stream, "42"); stream_bucket_append($out, $bucket); @@ -34,7 +34,7 @@ class test_filter3 extends php_user_filter { } } class test_filter4 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { + function filter($in, $out, &$consumed, $closing): int { if (!$closing) { $bucket = stream_bucket_new($this->stream, "42"); } diff --git a/ext/standard/tests/filters/php_user_filter_01.phpt b/ext/standard/tests/filters/php_user_filter_01.phpt index fb56857a1846f..987f9c766bfba 100644 --- a/ext/standard/tests/filters/php_user_filter_01.phpt +++ b/ext/standard/tests/filters/php_user_filter_01.phpt @@ -3,15 +3,15 @@ class php_user_filter#1 --FILE-- --EXPECTF-- -Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d +Fatal error: Declaration of bar::filter($in, $out, &$consumed): int must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d diff --git a/ext/standard/tests/filters/php_user_filter_02.phpt b/ext/standard/tests/filters/php_user_filter_02.phpt index b1a141e6f2be3..20a3bba844cb1 100644 --- a/ext/standard/tests/filters/php_user_filter_02.phpt +++ b/ext/standard/tests/filters/php_user_filter_02.phpt @@ -3,10 +3,10 @@ class php_user_filter#2 --FILE-- --EXPECTF-- -Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d +Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing): int must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d diff --git a/ext/standard/tests/filters/php_user_filter_03.phpt b/ext/standard/tests/filters/php_user_filter_03.phpt index a89637d4ccab3..1f849f911a235 100644 --- a/ext/standard/tests/filters/php_user_filter_03.phpt +++ b/ext/standard/tests/filters/php_user_filter_03.phpt @@ -3,10 +3,10 @@ class php_user_filter#3 --FILE-- --EXPECTF-- -Fatal error: Declaration of foo::onCreate($var) must be compatible with php_user_filter::onCreate() in %s on line %d +Fatal error: Declaration of foo::onCreate($var): bool must be compatible with php_user_filter::onCreate() in %s on line %d diff --git a/ext/standard/tests/filters/php_user_filter_onCreate_failure.phpt b/ext/standard/tests/filters/php_user_filter_onCreate_failure.phpt index 5b0c1d5d9c60b..f8a0b3d029f5d 100644 --- a/ext/standard/tests/filters/php_user_filter_onCreate_failure.phpt +++ b/ext/standard/tests/filters/php_user_filter_onCreate_failure.phpt @@ -4,7 +4,7 @@ php_user_filter onCreate() returns false data = strtoupper($bucket->data); diff --git a/ext/standard/tests/streams/stream_filter_register.phpt b/ext/standard/tests/streams/stream_filter_register.phpt index 6ac28a117406f..72c5d82114bd7 100644 --- a/ext/standard/tests/streams/stream_filter_register.phpt +++ b/ext/standard/tests/streams/stream_filter_register.phpt @@ -6,12 +6,14 @@ User Group: PHP-WVL & PHPGent #PHPTestFest --FILE-- data; diff --git a/ext/tidy/tidy_arginfo.h b/ext/tidy/tidy_arginfo.h index 30c9f1af693be..f2dd73bccbeb2 100644 --- a/ext/tidy/tidy_arginfo.h +++ b/ext/tidy/tidy_arginfo.h @@ -95,42 +95,54 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, useIncludePath, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_getOpt, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_tidy_getOpt, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_cleanRepair, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_cleanRepair, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseFile, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_parseFile, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, config, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, useIncludePath, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseString, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_parseString, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, config, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_tidy_repairString arginfo_class_tidy_parseString +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_tidy_repairString, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, config, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() -#define arginfo_class_tidy_repairFile arginfo_class_tidy_parseFile +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_tidy_repairFile, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, config, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, useIncludePath, _IS_BOOL, 0, "false") +ZEND_END_ARG_INFO() #define arginfo_class_tidy_diagnose arginfo_class_tidy_cleanRepair -#define arginfo_class_tidy_getRelease arginfo_class_tidy_cleanRepair +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_getRelease, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_tidy_getConfig arginfo_class_tidy_cleanRepair +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_getConfig, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_tidy_getStatus arginfo_class_tidy_cleanRepair +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_tidy_getStatus, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_tidy_getHtmlVer arginfo_class_tidy_cleanRepair +#define arginfo_class_tidy_getHtmlVer arginfo_class_tidy_getStatus #if defined(HAVE_TIDYOPTGETDOC) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_getOptDoc, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_tidy_getOptDoc, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) ZEND_END_ARG_INFO() #endif @@ -139,15 +151,17 @@ ZEND_END_ARG_INFO() #define arginfo_class_tidy_isXml arginfo_class_tidy_cleanRepair -#define arginfo_class_tidy_root arginfo_class_tidy_cleanRepair +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_tidy_root, 0, 0, tidyNode, 1) +ZEND_END_ARG_INFO() -#define arginfo_class_tidy_head arginfo_class_tidy_cleanRepair +#define arginfo_class_tidy_head arginfo_class_tidy_root -#define arginfo_class_tidy_html arginfo_class_tidy_cleanRepair +#define arginfo_class_tidy_html arginfo_class_tidy_root -#define arginfo_class_tidy_body arginfo_class_tidy_cleanRepair +#define arginfo_class_tidy_body arginfo_class_tidy_root -#define arginfo_class_tidyNode___construct arginfo_class_tidy_cleanRepair +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidyNode___construct, 0, 0, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_tidyNode_hasChildren, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index 4b1aac3824e05..375cdea9e3f07 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -10,7 +10,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_name, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_PhpToken_tokenize arginfo_token_get_all +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PhpToken_tokenize, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PhpToken___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0) diff --git a/ext/xmlreader/php_xmlreader_arginfo.h b/ext/xmlreader/php_xmlreader_arginfo.h index 0ce3fd862f406..b3efed2ca3c11 100644 --- a/ext/xmlreader/php_xmlreader_arginfo.h +++ b/ext/xmlreader/php_xmlreader_arginfo.h @@ -1,37 +1,44 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 49adb3008ade3f92f9b764ead9366efc6681e46f */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_close, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttribute, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttribute, 0, 1, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNo, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttributeNo, 0, 1, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 2, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getParserProperty, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getParserProperty, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLReader_isValid arginfo_class_XMLReader_close -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_lookupNamespace, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_lookupNamespace, 0, 1, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_XMLReader_moveToAttribute arginfo_class_XMLReader_getAttribute +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttribute, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_XMLReader_moveToAttributeNo arginfo_class_XMLReader_getAttributeNo +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttributeNo, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_XMLReader_moveToAttributeNs arginfo_class_XMLReader_getAttributeNs +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttributeNs, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +ZEND_END_ARG_INFO() #define arginfo_class_XMLReader_moveToElement arginfo_class_XMLReader_close @@ -41,44 +48,45 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLReader_read arginfo_class_XMLReader_close -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_next, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_next, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_open, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XMLReader_open, 0, 1, XMLReader, MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#define arginfo_class_XMLReader_readInnerXml arginfo_class_XMLReader_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_readInnerXml, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_XMLReader_readOuterXml arginfo_class_XMLReader_close +#define arginfo_class_XMLReader_readOuterXml arginfo_class_XMLReader_readInnerXml -#define arginfo_class_XMLReader_readString arginfo_class_XMLReader_close +#define arginfo_class_XMLReader_readString arginfo_class_XMLReader_readInnerXml -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setSchema, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setSchema, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setParserProperty, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setParserProperty, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLReader_setRelaxNGSchema arginfo_class_XMLReader_setSchema -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setRelaxNGSchemaSource, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setRelaxNGSchemaSource, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_XML, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XMLReader_XML, 0, 1, XMLReader, MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_expand, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XMLReader_expand, 0, 0, DOMNode, MAY_BE_FALSE) ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, baseNode, DOMNode, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/xmlwriter/php_xmlwriter_arginfo.h b/ext/xmlwriter/php_xmlwriter_arginfo.h index 7547479b3bf8c..a5c233d6e0783 100644 --- a/ext/xmlwriter/php_xmlwriter_arginfo.h +++ b/ext/xmlwriter/php_xmlwriter_arginfo.h @@ -175,18 +175,18 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_xmlwriter_flush, 0, 1, MAY_BE_ST ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, empty, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_openUri, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_openUri, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_openMemory, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_openMemory, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_setIndent, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_setIndent, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_setIndentString, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_setIndentString, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, indentation, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -194,24 +194,24 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endComment arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startAttribute, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startAttribute, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endAttribute arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeAttribute, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeAttribute, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startAttributeNs, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startAttributeNs, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeAttributeNs, 0, 0, 4) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeAttributeNs, 0, 4, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) @@ -226,25 +226,25 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_startElementNs arginfo_class_XMLWriter_startAttributeNs -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeElement, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeElement, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeElementNs, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeElementNs, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startPi, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startPi, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, target, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endPi arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writePi, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writePi, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, target, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -253,7 +253,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endCdata arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeCdata, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeCdata, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -261,7 +261,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_writeRaw arginfo_class_XMLWriter_writeCdata -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startDocument, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startDocument, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, version, IS_STRING, 1, "\"1.0\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, standalone, IS_STRING, 1, "null") @@ -271,7 +271,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_writeComment arginfo_class_XMLWriter_writeCdata -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startDtd, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startDtd, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, publicId, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, systemId, IS_STRING, 1, "null") @@ -279,20 +279,20 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endDtd arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeDtd, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeDtd, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, publicId, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, systemId, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startDtdElement, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startDtdElement, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endDtdElement arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeDtdElement, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeDtdElement, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -303,14 +303,14 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_writeDtdAttlist arginfo_class_XMLWriter_writeDtdElement -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_startDtdEntity, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startDtdEntity, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, isParam, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_endDtdEntity arginfo_class_XMLWriter_openMemory -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeDtdEntity, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeDtdEntity, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, isParam, _IS_BOOL, 0, "false") @@ -319,11 +319,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_writeDtdEntity, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, notationData, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_outputMemory, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_outputMemory, 0, 0, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flush, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLWriter_flush, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_XMLWriter_flush, 0, 0, MAY_BE_STRING|MAY_BE_LONG) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, empty, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() diff --git a/ext/xsl/php_xsl_arginfo.h b/ext/xsl/php_xsl_arginfo.h index f5be7aa731d29..bf3c34958b10f 100644 --- a/ext/xsl/php_xsl_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -1,53 +1,57 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: bcc89ca2603d60a9832704809fd8ab3834e79f74 */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 1, DOMDocument, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, returnClass, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToUri, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_transformToUri, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToXml, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_XSLTProcessor_transformToXml, 0, 1, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL) ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setParameter, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_setParameter, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, name, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_getParameter, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_XSLTProcessor_getParameter, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_XSLTProcessor_removeParameter arginfo_class_XSLTProcessor_getParameter +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_removeParameter, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_hasExsltSupport, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_hasExsltSupport, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_registerPHPFunctions, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_registerPHPFunctions, 0, 0, IS_VOID, 0) ZEND_ARG_TYPE_MASK(0, functions, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, preferences, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_class_XSLTProcessor_getSecurityPrefs arginfo_class_XSLTProcessor_hasExsltSupport +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XSLTProcessor_getSecurityPrefs, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() ZEND_METHOD(XSLTProcessor, importStylesheet); diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index 675e8d064afa4..29115ea424c4e 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -40,34 +40,36 @@ ZEND_END_ARG_INFO() #define arginfo_zip_entry_compressionmethod arginfo_zip_entry_name -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_open, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_open, 0, 1, MAY_BE_BOOL|MAY_BE_LONG) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setPassword, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setPassword, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_close, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_close, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_count arginfo_class_ZipArchive_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_getStatusString arginfo_class_ZipArchive_close +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_getStatusString, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addEmptyDir, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_addEmptyDir, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, dirname, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addFromString, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_addFromString, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ZipArchive::FL_OVERWRITE") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addFile, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_addFile, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, entryname, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") @@ -75,7 +77,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addFile, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ZipArchive::FL_OVERWRITE") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_replaceFile, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_replaceFile, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") @@ -83,48 +85,48 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_replaceFile, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addGlob, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_addGlob, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_addPattern, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_addPattern, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, path, IS_STRING, 0, "\".\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_renameIndex, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_renameIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, new_name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_renameName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_renameName, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, new_name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setArchiveComment, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setArchiveComment, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getArchiveComment, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getArchiveComment, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setCommentIndex, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setCommentIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setCommentName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setCommentName, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) ZEND_END_ARG_INFO() #if defined(HAVE_SET_MTIME) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setMtimeIndex, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setMtimeIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") @@ -132,36 +134,45 @@ ZEND_END_ARG_INFO() #endif #if defined(HAVE_SET_MTIME) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setMtimeName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setMtimeName, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getCommentIndex, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getCommentIndex, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getCommentName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getCommentName, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_deleteIndex, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_deleteIndex, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_deleteName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_deleteName, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_statName arginfo_class_ZipArchive_getCommentName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_statName, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_statIndex arginfo_class_ZipArchive_getCommentIndex +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_statIndex, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_locateName arginfo_class_ZipArchive_getCommentName +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_locateName, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() #define arginfo_class_ZipArchive_getNameIndex arginfo_class_ZipArchive_getCommentIndex @@ -173,27 +184,29 @@ ZEND_END_ARG_INFO() #define arginfo_class_ZipArchive_unchangeName arginfo_class_ZipArchive_deleteName -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_extractTo, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_extractTo, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, pathto, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, files, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getFromName, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getFromName, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getFromIndex, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_getFromIndex, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_getStream arginfo_class_ZipArchive_deleteName +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getStream, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() #if defined(ZIP_OPSYS_DEFAULT) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setExternalAttributesName, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setExternalAttributesName, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, opsys, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) @@ -202,7 +215,7 @@ ZEND_END_ARG_INFO() #endif #if defined(ZIP_OPSYS_DEFAULT) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setExternalAttributesIndex, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setExternalAttributesIndex, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, opsys, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) @@ -211,7 +224,7 @@ ZEND_END_ARG_INFO() #endif #if defined(ZIP_OPSYS_DEFAULT) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getExternalAttributesName, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_getExternalAttributesName, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_INFO(1, opsys) ZEND_ARG_INFO(1, attr) @@ -220,7 +233,7 @@ ZEND_END_ARG_INFO() #endif #if defined(ZIP_OPSYS_DEFAULT) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getExternalAttributesIndex, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_getExternalAttributesIndex, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_INFO(1, opsys) ZEND_ARG_INFO(1, attr) @@ -228,20 +241,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getExternalAttributesIndex, 0, 0 ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setCompressionName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setCompressionName, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compflags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setCompressionIndex, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setCompressionIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compflags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #if defined(HAVE_ENCRYPTION) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setEncryptionName, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setEncryptionName, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") @@ -249,7 +262,7 @@ ZEND_END_ARG_INFO() #endif #if defined(HAVE_ENCRYPTION) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setEncryptionIndex, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_setEncryptionIndex, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") @@ -257,14 +270,14 @@ ZEND_END_ARG_INFO() #endif #if defined(HAVE_PROGRESS_CALLBACK) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_registerProgressCallback, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_registerProgressCallback, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, rate, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() #endif #if defined(HAVE_CANCEL_CALLBACK) -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_registerCancelCallback, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_registerCancelCallback, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() #endif