Add a few missing parameter types in stubs

Related to GH-5627
This commit is contained in:
Máté Kocsis 2020-07-28 23:00:44 +02:00
parent 41de27ecc2
commit 0d330e1a02
No known key found for this signature in database
GPG key ID: FD055E41728BF310
35 changed files with 137 additions and 114 deletions

View file

@ -8,4 +8,4 @@ class Sub implements ArrayAccess {
}
?>
--EXPECTF--
Fatal error: Declaration of Sub::offsetSet() must be compatible with ArrayAccess::offsetSet($offset, $value) in %sargument_restriction_005.php on line %d
Fatal error: Declaration of Sub::offsetSet() must be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value) in %sargument_restriction_005.php on line %d

View file

@ -23,7 +23,7 @@ function strncasecmp(string $string1, string $string2, int $length): int {}
function error_reporting(?int $error_level = null): int {}
/** @param mixed $value */
function define(string $constant_name, $value, $case_insensitive = false): bool {}
function define(string $constant_name, $value, bool $case_insensitive = false): bool {}
function defined(string $constant_name): bool {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d1ab4864c1159916b45c8f272a2a1d708b2dca65 */
* Stub hash: 1f644f72600eddbbb01a4c3912a2c9c5fe12188e */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@ -40,7 +40,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_define, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, constant_name, IS_STRING, 0)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_defined, 0, 1, _IS_BOOL, 0)

View file

@ -17,6 +17,6 @@ final class Closure
public function call(object $newThis, mixed ...$arguments): mixed {}
/** @param callable $callback Not a proper type annotation due to bug #78770 */
/** @param callable $callback callable is not a proper type due to bug #78770. */
public static function fromCallable($callback): Closure {}
}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 57771cb65a3193bd683be75efd04f7daff0f8585 */
* Stub hash: 62198e96940fe0e86fe89601015c837aa5390e92 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure___construct, 0, 0, 0)
ZEND_END_ARG_INFO()

View file

@ -31,17 +31,19 @@ interface Iterator extends Traversable
interface ArrayAccess
{
/** @return bool */
public function offsetExists($offset);
public function offsetExists(mixed $offset);
/* actually this should be return by ref but atm cannot be */
/** @return mixed */
public function offsetGet($offset);
/**
* Actually this should be return by ref but atm cannot be.
* @return mixed
*/
public function offsetGet(mixed $offset);
/** @return void */
public function offsetSet($offset, $value);
public function offsetSet(mixed $offset, mixed $value);
/** @return void */
public function offsetUnset($offset);
public function offsetUnset(mixed $offset);
}
interface Serializable

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: c3b97b8a9c7522fc5b58e63fbf9cd6a801f4bbc2 */
* Stub hash: 1aa9ef81a738328a334176d37683646b60b2f6fa */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IteratorAggregate_getIterator, 0, 0, 0)
ZEND_END_ARG_INFO()
@ -15,14 +15,14 @@ ZEND_END_ARG_INFO()
#define arginfo_class_Iterator_rewind arginfo_class_IteratorAggregate_getIterator
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayAccess_offsetExists, 0, 0, 1)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_ArrayAccess_offsetGet arginfo_class_ArrayAccess_offsetExists
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayAccess_offsetSet, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, value)
ZEND_ARG_TYPE_INFO(0, offset, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_ArrayAccess_offsetUnset arginfo_class_ArrayAccess_offsetExists

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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()

View file

@ -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 {}

View file

@ -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()

View file

@ -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 */

View file

@ -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()

View file

@ -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 */

View file

@ -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)

View file

@ -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 {}

View file

@ -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)

View file

@ -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 {}

View file

@ -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")

View file

@ -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 {}

View file

@ -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)

View file

@ -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 {}

View file

@ -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

View file

@ -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)) {

View file

@ -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) {}

View file

@ -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

View file

@ -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 ]
}
}

View file

@ -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 {}

View file

@ -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")

View file

@ -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 {}

View file

@ -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()

View file

@ -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 {}

View file

@ -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)