diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-07-28 23:00:44 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-07-30 14:26:45 +0200 |
commit | 0d330e1a022d536de8a679d11dc8ec6f9fd64be3 (patch) | |
tree | a4b93785096169cca4ba3bb9109040311b374944 /ext | |
parent | 41de27ecc239e3a7de50446be297e288bb934505 (diff) | |
download | php-git-0d330e1a022d536de8a679d11dc8ec6f9fd64be3.tar.gz |
Add a few missing parameter types in stubs
Related to GH-5627
Diffstat (limited to 'ext')
28 files changed, 119 insertions, 98 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 802717bb9c..b024f092f5 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -288,18 +288,23 @@ PHP_FUNCTION(com_get_active_object) CLSID clsid; char *module_name; size_t module_name_len; - zend_long code_page = COMG(code_page); + zend_long code_page; + zend_bool code_page_is_null = 1; IUnknown *unk = NULL; IDispatch *obj = NULL; HRESULT res; OLECHAR *module = NULL; php_com_initialize(); - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", - &module_name, &module_name_len, &code_page)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l!", + &module_name, &module_name_len, &code_page, &code_page_is_null)) { RETURN_THROWS(); } + if (code_page_is_null) { + code_page = COMG(code_page); + } + module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page); res = CLSIDFromString(module, &clsid); diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index a39e792ae9..73b70f07ab 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -259,6 +259,7 @@ PHP_MINIT_FUNCTION(com_dotnet) COM_CONST(VARCMP_EQ); COM_CONST(VARCMP_GT); COM_CONST(VARCMP_NULL); + COM_CONST(LOCALE_SYSTEM_DEFAULT); COM_CONST(NORM_IGNORECASE); COM_CONST(NORM_IGNORENONSPACE); diff --git a/ext/com_dotnet/com_extension.stub.php b/ext/com_dotnet/com_extension.stub.php index d97a51968e..90c14df5bc 100644 --- a/ext/com_dotnet/com_extension.stub.php +++ b/ext/com_dotnet/com_extension.stub.php @@ -2,52 +2,51 @@ /** @generate-function-entries */ -function variant_set(variant $variant, $value): void {} +function variant_set(variant $variant, mixed $value): void {} -function variant_add($left, $right): variant {} +function variant_add(mixed $left, mixed $right): variant {} -function variant_cat($left, $right): variant {} +function variant_cat(mixed $left, mixed $right): variant {} -function variant_sub($left, $right): variant {} +function variant_sub(mixed $left, mixed $right): variant {} -function variant_mul($left, $right): variant {} +function variant_mul(mixed $left, mixed $right): variant {} -function variant_and($left, $right): variant {} +function variant_and(mixed $left, mixed $right): variant {} -function variant_div($left, $right): variant {} +function variant_div(mixed $left, mixed $right): variant {} -function variant_eqv($left, $right): variant {} +function variant_eqv(mixed $left, mixed $right): variant {} -function variant_idiv($left, $right): variant {} +function variant_idiv(mixed $left, mixed $right): variant {} -function variant_imp($left, $right): variant {} +function variant_imp(mixed $left, mixed $right): variant {} -function variant_mod($left, $right): variant {} +function variant_mod(mixed $left, mixed $right): variant {} -function variant_or($left, $right): variant {} +function variant_or(mixed $left, mixed $right): variant {} -function variant_pow($left, $right): variant {} +function variant_pow(mixed $left, mixed $right): variant {} -function variant_xor($left, $right): variant {} +function variant_xor(mixed $left, mixed $right): variant {} -function variant_abs($left): variant {} +function variant_abs(mixed $left): variant {} -function variant_fix($left): variant {} +function variant_fix(mixed $left): variant {} -function variant_int($left): variant {} +function variant_int(mixed $left): variant {} -function variant_neg($left): variant {} +function variant_neg(mixed $left): variant {} -function variant_not($left): variant {} +function variant_not(mixed $left): variant {} -function variant_round($left, int $decimals): ?variant {} +function variant_round(mixed $left, int $decimals): ?variant {} -function variant_cmp($left, $right, int $lcid = UNKNOWN, int $flags = 0): int {} +function variant_cmp(mixed $left, mixed $right, int $lcid = LOCALE_SYSTEM_DEFAULT, int $flags = 0): int {} function variant_date_to_timestamp(variant $variant): ?int {} -/** @return variant|false */ -function variant_date_from_timestamp(int $timestamp) {} +function variant_date_from_timestamp(int $timestamp): variant|false {} function variant_get_type(variant $variant): int {} @@ -55,10 +54,11 @@ function variant_set_type(variant $variant, int $type): void {} function variant_cast(variant $variant, int $type): variant {} -function com_get_active_object(string $progid, int $code_page = UNKNOWN): variant {} +function com_get_active_object(string $progid, ?int $code_page = null): variant {} function com_create_guid(): string|false {} +/** @param array|string|null $sinkinterface */ function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = UNKNOWN): bool {} function com_print_typeinfo($comobject, ?string $dispinterface = null, bool $wantsink = false): bool {} @@ -69,7 +69,7 @@ function com_load_typelib(string $typelib_name, bool $case_insensitive = true): class variant { - public function __construct($value = null, int $type = VT_EMPTY, int $codepage = CP_ACP) {} + public function __construct(mixed $value = null, int $type = VT_EMPTY, int $codepage = CP_ACP) {} } class com diff --git a/ext/com_dotnet/com_extension_arginfo.h b/ext/com_dotnet/com_extension_arginfo.h index 4ee6d37504..afe2f1b6ad 100644 --- a/ext/com_dotnet/com_extension_arginfo.h +++ b/ext/com_dotnet/com_extension_arginfo.h @@ -1,14 +1,14 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 965dcbb494d51bb3fd41a2898a1c53d7478fd699 */ + * Stub hash: caec4bba1103a07a86803ac0192782fef7d6680f */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, variant, variant, 0) - ZEND_ARG_INFO(0, value) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_add, 0, 2, variant, 0) - ZEND_ARG_INFO(0, left) - ZEND_ARG_INFO(0, right) + ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, right, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_variant_cat arginfo_variant_add @@ -36,7 +36,7 @@ ZEND_END_ARG_INFO() #define arginfo_variant_xor arginfo_variant_add ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_abs, 0, 1, variant, 0) - ZEND_ARG_INFO(0, left) + ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_variant_fix arginfo_variant_abs @@ -48,14 +48,14 @@ ZEND_END_ARG_INFO() #define arginfo_variant_not arginfo_variant_abs ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_round, 0, 2, variant, 1) - ZEND_ARG_INFO(0, left) + ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, decimals, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_cmp, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, left) - ZEND_ARG_INFO(0, right) - ZEND_ARG_TYPE_INFO(0, lcid, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, right, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lcid, IS_LONG, 0, "LOCALE_SYSTEM_DEFAULT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_date_to_timestamp, 0, 1, ZEND_ARG_OBJ_INFO(0, variant, variant, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_variant_date_from_timestamp, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_variant_date_from_timestamp, 0, 1, variant, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -83,7 +83,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_com_get_active_object, 0, 1, variant, 0) ZEND_ARG_TYPE_INFO(0, progid, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, code_page, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code_page, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_com_create_guid, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) @@ -111,7 +111,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_load_typelib, 0, 1, _IS_BOOL ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_variant___construct, 0, 0, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, value, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_MIXED, 0, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "VT_EMPTY") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, codepage, IS_LONG, 0, "CP_ACP") ZEND_END_ARG_INFO() diff --git a/ext/enchant/enchant.stub.php b/ext/enchant/enchant.stub.php index 457e55e64b..e39f3cd041 100644 --- a/ext/enchant/enchant.stub.php +++ b/ext/enchant/enchant.stub.php @@ -38,6 +38,7 @@ function enchant_broker_set_ordering(EnchantBroker $broker, string $tag, string function enchant_broker_describe(EnchantBroker $broker): array {} +/** @param array $suggestions */ function enchant_dict_quick_check(EnchantDictionary $dict, string $word, &$suggestions = null): bool {} function enchant_dict_check(EnchantDictionary $dict, string $word): bool {} diff --git a/ext/enchant/enchant_arginfo.h b/ext/enchant/enchant_arginfo.h index adbbc3779f..94fdb781a4 100644 --- a/ext/enchant/enchant_arginfo.h +++ b/ext/enchant/enchant_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5a67e10da7a70552110e807118a33d1d7bb028da */ + * Stub hash: 22c47f0b30f6952a42546c403fbd2e92836661fa */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_init, 0, 0, EnchantBroker, MAY_BE_FALSE) ZEND_END_ARG_INFO() diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index 22f2c4f256..deef81f7f9 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -123,9 +123,9 @@ function imagejpeg(GdImage $im, $to = null, int $quality = -1): bool {} /** @param resource|string|null $to */ function imagewbmp(GdImage $im, $to = null, ?int $foreground = null): bool {} -function imagegd(GdImage $im, $to = UNKNOWN): bool {} +function imagegd(GdImage $im, string $to = UNKNOWN): bool {} -function imagegd2(GdImage $im, $to = UNKNOWN, int $chunk_size = UNKNOWN, int $type = UNKNOWN): bool {} +function imagegd2(GdImage $im, string $to = UNKNOWN, int $chunk_size = UNKNOWN, int $type = UNKNOWN): bool {} #ifdef HAVE_GD_BMP /** @param resource|string|null $to */ diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 371c3e2ecb..c489fc0c3c 100644 --- a/ext/gd/gd_arginfo.h +++ b/ext/gd/gd_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 14cd8fc3865f7ef2b88c4834fbf33d360b302794 */ + * Stub hash: a792b0c5497013c85cca83c4baab928a5191f3b9 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -241,12 +241,12 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegd, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, im, GdImage, 0) - ZEND_ARG_INFO(0, to) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegd2, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, im, GdImage, 0) - ZEND_ARG_INFO(0, to) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, chunk_size, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php index bfa4ba93ee..d7d6b57667 100644 --- a/ext/gmp/gmp.stub.php +++ b/ext/gmp/gmp.stub.php @@ -90,26 +90,26 @@ function gmp_sqrt($a): GMP|false {} /** @param GMP|int|bool|string $a */ function gmp_sqrtrem($a): array|false {} -/** @param GMP|int|bool|string $a **/ +/** @param GMP|int|bool|string $a */ function gmp_root($a, int $nth): GMP|false {} -/** @param GMP|int|bool|string $a **/ +/** @param GMP|int|bool|string $a */ function gmp_rootrem($a, int $nth): array|false {} -/** @param GMP|int|bool|string $base **/ +/** @param GMP|int|bool|string $base */ function gmp_pow($base, int $exp): GMP|false {} /** * @param GMP|int|bool|string $base * @param GMP|int|bool|string $exp * @param GMP|int|bool|string $mod - **/ + */ function gmp_powm($base, $exp, $mod): GMP|false {} -/** @param GMP|int|bool|string $a **/ +/** @param GMP|int|bool|string $a */ function gmp_perfect_square($a): bool {} -/** @param GMP|int|bool|string $a **/ +/** @param GMP|int|bool|string $a */ function gmp_perfect_power($a): bool {} /** @param GMP|int|bool|string $a */ diff --git a/ext/gmp/gmp_arginfo.h b/ext/gmp/gmp_arginfo.h index 5208204241..1c5903bb96 100644 --- a/ext/gmp/gmp_arginfo.h +++ b/ext/gmp/gmp_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3f96612dbbeac0ae619461e400e91b3a15e0cd9c */ + * Stub hash: 4b5e54ee34a3cb6471d5a3c30c50e218a80347c0 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_gmp_init, 0, 1, GMP, MAY_BE_FALSE) ZEND_ARG_INFO(0, number) diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index f8788ed61e..6a660aeaef 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -30,10 +30,6 @@ function hash_hmac_algos(): array {} function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $raw_output = false): string {} -/** - * @param $known_string no type juggling is performed - * @param $user_string no type juggling is performed - */ function hash_equals(string $known_string, string $user_string): bool {} function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {} diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index c877c88e5c..b51be84792 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d4caa0bf70c25a8436049197e822a6c85e4e4643 */ + * Stub hash: 6da0ff3370cecc919fccf7c6791828a81b44156d */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php index 9708f6d359..aa86364e60 100644 --- a/ext/intl/php_intl.stub.php +++ b/ext/intl/php_intl.stub.php @@ -366,6 +366,7 @@ function intltz_create_time_zone_id_enumeration(int $zoneType, ?string $region = function intltz_from_date_time_zone(DateTimeZone $zone): ?IntlTimeZone {} +/** @param bool $isSystemID */ function intltz_get_canonical_id(string $zoneId, &$isSystemID = null): string|false {} function intltz_get_display_name(IntlTimeZone $tz, bool $isDaylight = false, int $style = IntlTimeZone::DISPLAY_LONG, ?string $locale = null): string|false {} @@ -414,7 +415,7 @@ function transliterator_list_ids(): array|false {} function transliterator_create_inverse(Transliterator $orig_trans): ?Transliterator {} -/** @param Transliterator|string */ +/** @param Transliterator|string $transliterator */ function transliterator_transliterate($transliterator, string $subject, int $start = 0, int $end = -1): string|false {} function transliterator_get_error_code(Transliterator $trans): int|false {} diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h index f9e2cbd152..463c36c7b2 100644 --- a/ext/intl/php_intl_arginfo.h +++ b/ext/intl/php_intl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6130944985187815dd839f7425213f91c3261735 */ + * Stub hash: a90502c989d9c9b41753def3e00b953e0cbe660d */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null") diff --git a/ext/mbstring/mbstring.stub.php b/ext/mbstring/mbstring.stub.php index 6bd6aeae6f..343a5d103d 100644 --- a/ext/mbstring/mbstring.stub.php +++ b/ext/mbstring/mbstring.stub.php @@ -16,6 +16,7 @@ function mb_substitute_character(string|int|null $substitute_character = null): function mb_preferred_mime_name(string $encoding): string|false {} +/** @param array $result */ function mb_parse_str(string $encoded_string, &$result): bool {} function mb_output_handler(string $contents, int $status): string {} @@ -70,7 +71,7 @@ function mb_decode_mimeheader(string $string): string {} function mb_convert_kana(string $str, string $option = "KV", ?string $encoding = null): string {} -function mb_convert_variables(string $to, array|string $from, &$var, &...$vars): string|false {} +function mb_convert_variables(string $to, array|string $from, mixed &$var, mixed &...$vars): string|false {} function mb_encode_numericentity(string $string, array $convmap, ?string $encoding = null, bool $is_hex = false): string {} @@ -92,8 +93,10 @@ function mb_chr(int $cp, ?string $encoding = null): string|false {} #ifdef HAVE_MBREGEX function mb_regex_encoding(?string $encoding = null): string|bool {} +/** @param array $registers */ function mb_ereg(string $pattern, string $string, &$registers = null): int|false {} +/** @param array $registers */ function mb_eregi(string $pattern, string $string, &$registers = null): int|false {} function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {} diff --git a/ext/mbstring/mbstring_arginfo.h b/ext/mbstring/mbstring_arginfo.h index 66fb381ed4..7267b943ef 100644 --- a/ext/mbstring/mbstring_arginfo.h +++ b/ext/mbstring/mbstring_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 282413dbcb1b92e1efadf4352f443692076aea59 */ + * Stub hash: 5ad8a8cf20eeae59713d19135ecccbee243754eb */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null") @@ -157,8 +157,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_variables, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_INFO(1, var) - ZEND_ARG_VARIADIC_INFO(1, vars) + ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_numericentity, 0, 2, IS_STRING, 0) diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index 5e73f34fa0..84d95b24d7 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -238,14 +238,14 @@ class mysqli public function set_charset(string $charset) {} /** - * @param mixed $value + * @param string|int $value * @return bool * @alias mysqli_options */ public function options(int $option, $value) {} /** - * @param mixed $value + * @param string|int $value * @return bool * @alias mysqli_options */ @@ -633,7 +633,7 @@ function mysqli_num_fields(mysqli_result $mysql_result): int {} function mysqli_num_rows(mysqli_result $mysqli_result): int|string {} -/** @param mixed $value */ +/** @param string|int $value */ function mysqli_options(mysqli $mysqli_link, int $option, $value): bool {} function mysqli_ping(mysqli $mysqli_link): bool {} @@ -681,8 +681,7 @@ function mysqli_stmt_attr_set(mysqli_stmt $mysql_stmt, int $attr, int $mode_in): function mysqli_stmt_bind_param(mysqli_stmt $mysql_stmt, string $types, mixed &...$vars): bool {} -/** @param mixed &...$vars */ -function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, &...$vars): bool {} +function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, mixed &...$vars): bool {} function mysqli_stmt_close(mysqli_stmt $mysql_stmt): bool {} @@ -757,7 +756,7 @@ function mysqli_refresh(mysqli $mysqli_link, int $options): bool {} function mysqli_escape_string(mysqli $mysqli_link, string $string_to_escape): string {} /** - * @param mixed $value + * @param string|int $value * @alias mysqli_options */ function mysqli_set_opt(mysqli $mysqli_link, int $option, $value): bool {} diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 3b2b995dc5..28145d1460 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: cde1bbb449c6adae7a99c7df3e9d290d501e18be */ + * Stub hash: 0fb73727b9ca9f4fa9827fecd948b60948ddc423 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) @@ -304,7 +304,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_bind_result, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) - ZEND_ARG_VARIADIC_INFO(1, vars) + ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_close arginfo_mysqli_stmt_execute diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 5172b928e3..1d6d6b7a8d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3089,16 +3089,20 @@ ZEND_METHOD(ReflectionMethod, __toString) ZEND_METHOD(ReflectionMethod, getClosure) { reflection_object *intern; - zval *obj; + zval *obj = NULL; zend_function *mptr; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &obj) == FAILURE) { + RETURN_THROWS(); + } + GET_REFLECTION_OBJECT_PTR(mptr); if (mptr->common.fn_flags & ZEND_ACC_STATIC) { zend_create_fake_closure(return_value, mptr, mptr->common.scope, mptr->common.scope, NULL); } else { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) { - RETURN_THROWS(); + if (!obj) { + zend_argument_value_error(1, "cannot be null for non-static methods"); } if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) { diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 58da7ebeee..539520597f 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -177,7 +177,7 @@ class ReflectionMethod extends ReflectionFunctionAbstract public function isDestructor() {} /** @return Closure */ - public function getClosure($object = UNKNOWN) {} + public function getClosure(?object $object = null) {} /** @return int */ public function getModifiers() {} @@ -325,10 +325,10 @@ class ReflectionClass implements Reflector public function getStaticProperties() {} /** @return mixed */ - public function getStaticPropertyValue(string $name, $default = UNKNOWN) {} + public function getStaticPropertyValue(string $name, mixed $default = UNKNOWN) {} /** @return void */ - public function setStaticPropertyValue(string $name, $value) {} + public function setStaticPropertyValue(string $name, mixed $value) {} /** @return array */ public function getDefaultProperties() {} @@ -385,7 +385,7 @@ class ReflectionProperty implements Reflector public function getValue(?object $object = null) {} /** @return void */ - public function setValue($objectOrValue, $value = UNKNOWN) {} + public function setValue(mixed $objectOrValue, mixed $value = UNKNOWN) {} /** @return bool */ public function isInitialized(?object $object = null) {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index 27125fc815..00013c7a50 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0a3d9fb707ddf5e508075799bf06ff42b849a4b8 */ + * Stub hash: beaf79270ab56d2e87a301a4a5d4444b2cc520d8 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) @@ -124,7 +124,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionMethod_isDestructor arginfo_class_ReflectionFunctionAbstract___clone ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_getClosure, 0, 0, 0) - ZEND_ARG_INFO(0, object) + 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___clone @@ -247,12 +247,12 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_getStaticPropertyValue, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_INFO(0, default) + 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_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_INFO(0, value) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_getDefaultProperties arginfo_class_ReflectionFunctionAbstract___clone @@ -292,16 +292,14 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty_getName arginfo_class_ReflectionFunctionAbstract___clone -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty_getValue, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, object, IS_OBJECT, 1, "null") -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionProperty_getValue arginfo_class_ReflectionMethod_getClosure ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty_setValue, 0, 0, 1) - ZEND_ARG_INFO(0, objectOrValue) - ZEND_ARG_INFO(0, value) + 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_ReflectionProperty_getValue +#define arginfo_class_ReflectionProperty_isInitialized arginfo_class_ReflectionMethod_getClosure #define arginfo_class_ReflectionProperty_isPublic arginfo_class_ReflectionFunctionAbstract___clone diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index 932d40f495..bb9ead8ce3 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -301,7 +301,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String - Parameters [2] { Parameter #0 [ <required> string $name ] - Parameter #1 [ <optional> $default = <default> ] + Parameter #1 [ <optional> mixed $default = <default> ] } } @@ -309,7 +309,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String - Parameters [2] { Parameter #0 [ <required> string $name ] - Parameter #1 [ <required> $value ] + Parameter #1 [ <required> mixed $value ] } } diff --git a/ext/session/session.stub.php b/ext/session/session.stub.php index 336a35b731..e70669d5a8 100644 --- a/ext/session/session.stub.php +++ b/ext/session/session.stub.php @@ -39,12 +39,24 @@ function session_register_shutdown(): void {} /** @alias session_write_close */ function session_commit(): bool {} +/** + * @param callable|object $open + * @param callable|bool $close + * @param callable $read + * @param callable $write + * @param callable $destroy + * @param callable $gc + * @param callable $create_sid + * @param callable $validate_sid + * @param callable $update_timestamp + */ function session_set_save_handler($open, $close = UNKNOWN, $read = UNKNOWN, $write = UNKNOWN, $destroy = UNKNOWN, $gc = UNKNOWN, $create_sid = UNKNOWN, $validate_sid = UNKNOWN, $update_timestamp = UNKNOWN): bool {} function session_cache_limiter(?string $cache_limiter = null): string|false {} function session_cache_expire(?int $new_cache_expire = null): int|false {} +/** @param int|array $lifetime_or_options */ function session_set_cookie_params($lifetime_or_options, string $path = UNKNOWN, string $domain = "", ?bool $secure = null, ?bool $httponly = null): bool {} function session_start(array $options = []): bool {} diff --git a/ext/session/session_arginfo.h b/ext/session/session_arginfo.h index 10556941ac..622eb4cfb5 100644 --- a/ext/session/session_arginfo.h +++ b/ext/session/session_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c026a3449eacd0873d72423483d375d40105e9a0 */ + * Stub hash: 9e4a4b1d719197772b283abfb1e515180d7b8bb0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_name, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 7fbb4b0960..31161cdf03 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1337,7 +1337,7 @@ function gettype(mixed $var): string {} function get_debug_type(mixed $var): string {} -function settype(&$var, string $type): bool {} +function settype(mixed &$var, string $type): bool {} function intval(mixed $value, int $base = 10): int {} @@ -1379,6 +1379,7 @@ function is_object(mixed $value): bool {} function is_scalar(mixed $value): bool {} +/** @param string $callable_name */ function is_callable(mixed $value, bool $syntax_only = false, &$callable_name = null): bool {} function is_iterable(mixed $value): bool {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index eb26e1d86a..9eb97f1df3 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 22afbf7f01658785162ad9c82e09f1f11d3fb13a */ + * Stub hash: ced7e5bc2c202a0678a5616bc1ffd2ef0df66723 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -2057,7 +2057,7 @@ ZEND_END_ARG_INFO() #define arginfo_get_debug_type arginfo_gettype ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_settype, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(1, var) + ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index be8402aab7..cc4a561f54 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -20,7 +20,7 @@ function zend_test_nullable_array_return(): ?array {} function zend_test_void_return(): void {} /** @deprecated */ -function zend_test_deprecated($arg = UNKNOWN): void {} +function zend_test_deprecated(mixed $arg = null): void {} function zend_create_unterminated_string(string $str): string {} diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index b406edf24f..ae7cd77b58 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d2f58424106d78e0bb3b363c34fa94472b5e758d */ + * Stub hash: 82fd97d4985448884141842955a4bee2c90ba338 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -11,7 +11,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_void_return, 0, 0, IS_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_deprecated, 0, 0, IS_VOID, 0) - ZEND_ARG_INFO(0, arg) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg, IS_MIXED, 0, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_create_unterminated_string, 0, 1, IS_STRING, 0) |