diff --git a/Zend/Optimizer/zend_func_infos.h b/Zend/Optimizer/zend_func_infos.h index 6ace0a5081c6a..9a3c2a2ac35fb 100644 --- a/Zend/Optimizer/zend_func_infos.h +++ b/Zend/Optimizer/zend_func_infos.h @@ -7,9 +7,7 @@ static const func_info_t func_infos[] = { F1("get_class_methods", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), F1("get_included_files", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), FN("set_error_handler", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT|MAY_BE_NULL), - F0("restore_error_handler", MAY_BE_TRUE), FN("set_exception_handler", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT|MAY_BE_NULL), - F0("restore_exception_handler", MAY_BE_TRUE), F1("get_declared_classes", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), F1("get_declared_traits", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), F1("get_declared_interfaces", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), @@ -268,10 +266,8 @@ static const func_info_t func_infos[] = { #endif F1("mysqli_affected_rows", MAY_BE_LONG|MAY_BE_STRING), F1("mysqli_character_set_name", MAY_BE_STRING), - F0("mysqli_close", MAY_BE_TRUE), F1("mysqli_connect", MAY_BE_OBJECT|MAY_BE_FALSE), F1("mysqli_connect_error", MAY_BE_STRING|MAY_BE_NULL), - F0("mysqli_debug", MAY_BE_TRUE), F1("mysqli_error", MAY_BE_STRING), F1("mysqli_error_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY), F1("mysqli_fetch_field", MAY_BE_OBJECT|MAY_BE_FALSE), @@ -300,7 +296,6 @@ static const func_info_t func_infos[] = { F1("mysqli_real_escape_string", MAY_BE_STRING), F1("mysqli_reap_async_query", MAY_BE_OBJECT|MAY_BE_BOOL), F1("mysqli_stmt_affected_rows", MAY_BE_LONG|MAY_BE_STRING), - F0("mysqli_stmt_close", MAY_BE_TRUE), F1("mysqli_stmt_error", MAY_BE_STRING), F1("mysqli_stmt_error_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY), F1("mysqli_stmt_get_result", MAY_BE_OBJECT|MAY_BE_FALSE), @@ -311,7 +306,6 @@ static const func_info_t func_infos[] = { F1("mysqli_stmt_result_metadata", MAY_BE_OBJECT|MAY_BE_FALSE), F1("mysqli_stmt_sqlstate", MAY_BE_STRING), F1("mysqli_sqlstate", MAY_BE_STRING), - F0("mysqli_ssl_set", MAY_BE_TRUE), F1("mysqli_stat", MAY_BE_STRING|MAY_BE_FALSE), F1("mysqli_store_result", MAY_BE_OBJECT|MAY_BE_FALSE), F1("mysqli_use_result", MAY_BE_OBJECT|MAY_BE_FALSE), @@ -438,7 +432,6 @@ static const func_info_t func_infos[] = { F1("socket_addrinfo_explain", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY), FN("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), FN("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), - F0("sodium_crypto_generichash_update", MAY_BE_TRUE), #if defined(crypto_secretstream_xchacha20poly1305_ABYTES) FN("sodium_crypto_secretstream_xchacha20poly1305_init_push", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), #endif @@ -455,20 +448,9 @@ static const func_info_t func_infos[] = { F1("ob_get_clean", MAY_BE_STRING|MAY_BE_FALSE), F1("ob_list_handlers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), F1("ob_get_status", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY), - F0("krsort", MAY_BE_TRUE), - F0("ksort", MAY_BE_TRUE), - F0("asort", MAY_BE_TRUE), - F0("arsort", MAY_BE_TRUE), - F0("sort", MAY_BE_TRUE), - F0("usort", MAY_BE_TRUE), - F0("uasort", MAY_BE_TRUE), - F0("uksort", MAY_BE_TRUE), - F0("array_walk", MAY_BE_TRUE), - F0("array_walk_recursive", MAY_BE_TRUE), F1("compact", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF), FN("array_fill", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY), F1("array_fill_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF), - F0("shuffle", MAY_BE_TRUE), F1("array_replace", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF), F1("array_replace_recursive", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF), FN("array_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING), @@ -544,12 +526,6 @@ static const func_info_t func_infos[] = { F1("md5_file", MAY_BE_STRING|MAY_BE_FALSE), F1("sha1", MAY_BE_STRING), F1("sha1_file", MAY_BE_STRING|MAY_BE_FALSE), -#if defined(HAVE_SYSLOG_H) - F0("closelog", MAY_BE_TRUE), -#endif -#if defined(HAVE_SYSLOG_H) - F0("syslog", MAY_BE_TRUE), -#endif #if defined(HAVE_INET_NTOP) F1("inet_ntop", MAY_BE_STRING|MAY_BE_FALSE), #endif @@ -639,9 +615,7 @@ static const func_info_t func_infos[] = { F1("image_type_to_extension", MAY_BE_STRING|MAY_BE_FALSE), F1("getimagesize", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), F1("getimagesizefromstring", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), - F0("phpinfo", MAY_BE_TRUE), F1("phpversion", MAY_BE_STRING|MAY_BE_FALSE), - F0("phpcredits", MAY_BE_TRUE), F1("php_sapi_name", MAY_BE_STRING|MAY_BE_FALSE), F1("php_uname", MAY_BE_STRING), F1("php_ini_scanned_files", MAY_BE_STRING|MAY_BE_FALSE), diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index 20acca3a47ff7..bf6b8242c5a81 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -102,14 +102,12 @@ function user_error(string $message, int $error_level = E_USER_NOTICE): bool {} /** @return callable|null */ function set_error_handler(?callable $callback, int $error_levels = E_ALL) {} -/** @return true */ -function restore_error_handler(): bool {} +function restore_error_handler(): true {} /** @return callable|null */ function set_exception_handler(?callable $callback) {} -/** @return true */ -function restore_exception_handler(): bool {} +function restore_exception_handler(): true {} /** * @return array diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index 37ea1f7aab1b3..c4bfc3c48b036 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 69dcb08ae12b6acbba872f7de5018ca5c0aaf669 */ + * Stub hash: 33a976db268b72cee985011198125f652bc6c86d */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -139,7 +139,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_set_error_handler, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_levels, IS_LONG, 0, "E_ALL") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_restore_error_handler, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_restore_error_handler, 0, 0, IS_TRUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_set_exception_handler, 0, 0, 1) @@ -207,7 +207,8 @@ ZEND_END_ARG_INFO() #define arginfo_gc_collect_cycles arginfo_func_num_args -#define arginfo_gc_enabled arginfo_restore_error_handler +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gc_enabled, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gc_enable, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() diff --git a/build/gen_stub.php b/build/gen_stub.php index 4fbda773d5a3d..18763844280fa 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -188,6 +188,11 @@ public static function fromNode(Node $node): SimpleType { return new SimpleType($node->toLowerString(), true); } + if ($node->toLowerString() === 'true') { + // TODO PHP-Parser doesn't yet recognize true as a stand-alone built-in type + return new SimpleType($node->toLowerString(), true); + } + if ($node->toLowerString() === 'self') { throw new Exception('The exact class name must be used instead of "self"'); } @@ -380,6 +385,8 @@ public function toTypeCode(): string { return "IS_NULL"; case "false": return "IS_FALSE"; + case "true": + return "IS_TRUE"; default: throw new Exception("Not implemented: $this->name"); } @@ -393,6 +400,8 @@ public function toTypeMask(): string { return "MAY_BE_NULL"; case "false": return "MAY_BE_FALSE"; + case "true": + return "MAY_BE_TRUE"; case "bool": return "MAY_BE_BOOL"; case "int": @@ -443,6 +452,8 @@ public function toOptimizerTypeMaskForArrayValue(): string { return "MAY_BE_ARRAY_OF_NULL"; case "false": return "MAY_BE_ARRAY_OF_FALSE"; + case "true": + return "MAY_BE_ARRAY_OF_TRUE"; case "bool": return "MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE"; case "int": @@ -472,8 +483,6 @@ public function toOptimizerTypeMask(): string { } switch ($this->name) { - case "true": - return "MAY_BE_TRUE"; case "resource": return "MAY_BE_RESOURCE"; case "callable": diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index fe86c8478f223..288882a2a50ad 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -749,8 +749,7 @@ function mysqli_change_user(mysqli $mysql, string $username, string $password, ? /** @refcount 1 */ function mysqli_character_set_name(mysqli $mysql): string {} -/** @return true */ -function mysqli_close(mysqli $mysql): bool {} // TODO make return type void +function mysqli_close(mysqli $mysql): true {} // TODO make return type void function mysqli_commit(mysqli $mysql, int $flags = 0, ?string $name = null): bool {} @@ -776,8 +775,7 @@ function mysqli_data_seek(mysqli_result $result, int $offset): bool {} function mysqli_dump_debug_info(mysqli $mysql): bool {} -/** @return true */ -function mysqli_debug(string $options): bool {} // TODO make return type void +function mysqli_debug(string $options): true {} // TODO make return type void function mysqli_errno(mysqli $mysql): int {} @@ -976,8 +974,7 @@ function mysqli_stmt_bind_param(mysqli_stmt $statement, string $types, mixed &.. function mysqli_stmt_bind_result(mysqli_stmt $statement, mixed &...$vars): bool {} -/** @return true */ -function mysqli_stmt_close(mysqli_stmt $statement): bool {} +function mysqli_stmt_close(mysqli_stmt $statement): true {} function mysqli_stmt_data_seek(mysqli_stmt $statement, int $offset): void {} @@ -1036,7 +1033,6 @@ function mysqli_stmt_sqlstate(mysqli_stmt $statement): string {} /** @refcount 1 */ function mysqli_sqlstate(mysqli $mysql): string {} -/** @return true */ function mysqli_ssl_set( mysqli $mysql, ?string $key, @@ -1044,7 +1040,7 @@ function mysqli_ssl_set( ?string $ca_certificate, ?string $ca_path, ?string $cipher_algos -): bool {} // TODO make return type void +): true {} // TODO make return type void /** @refcount 1 */ function mysqli_stat(mysqli $mysql): string|false {} diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 606d893799dc9..6e0a7f5bb1545 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: db2ec0349b8b40e9352569e08cb4a3bd253f0255 */ + * Stub hash: e528bb1e05a85d3d764272c5f3f4256d2608da6c */ 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, mysqli, 0) @@ -27,7 +27,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_character_set_name, 0, 1, ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_close, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_close, 0, 1, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() @@ -53,9 +53,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_data_seek, 0, 2, _IS_BOOL ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_dump_debug_info arginfo_mysqli_close +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_dump_debug_info, 0, 1, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_debug, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_debug, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -178,14 +180,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_kill, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_more_results arginfo_mysqli_close +#define arginfo_mysqli_more_results arginfo_mysqli_dump_debug_info ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_multi_query, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_next_result arginfo_mysqli_close +#define arginfo_mysqli_next_result arginfo_mysqli_dump_debug_info #define arginfo_mysqli_num_fields arginfo_mysqli_field_tell @@ -201,7 +203,7 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_set_opt arginfo_mysqli_options -#define arginfo_mysqli_ping arginfo_mysqli_close +#define arginfo_mysqli_ping arginfo_mysqli_dump_debug_info ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_poll, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) @@ -295,7 +297,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_bind_result, 0, 1, _ ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_close, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_close, 0, 1, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, statement, mysqli_stmt, 0) ZEND_END_ARG_INFO() @@ -340,9 +342,11 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_insert_id arginfo_mysqli_stmt_affected_rows -#define arginfo_mysqli_stmt_more_results arginfo_mysqli_stmt_close +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_more_results, 0, 1, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, statement, mysqli_stmt, 0) +ZEND_END_ARG_INFO() -#define arginfo_mysqli_stmt_next_result arginfo_mysqli_stmt_close +#define arginfo_mysqli_stmt_next_result arginfo_mysqli_stmt_more_results #define arginfo_mysqli_stmt_num_rows arginfo_mysqli_stmt_affected_rows @@ -353,7 +357,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_prepare, 0, 2, _IS_B ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_stmt_reset arginfo_mysqli_stmt_close +#define arginfo_mysqli_stmt_reset arginfo_mysqli_stmt_more_results #define arginfo_mysqli_stmt_result_metadata arginfo_mysqli_stmt_get_result @@ -363,13 +367,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_send_long_data, 0, 3 ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_stmt_store_result arginfo_mysqli_stmt_close +#define arginfo_mysqli_stmt_store_result arginfo_mysqli_stmt_more_results #define arginfo_mysqli_stmt_sqlstate arginfo_mysqli_stmt_error #define arginfo_mysqli_sqlstate arginfo_mysqli_character_set_name -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_ssl_set, 0, 6, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_ssl_set, 0, 6, IS_TRUE, 0) ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, certificate, IS_STRING, 1) diff --git a/ext/sodium/libsodium.stub.php b/ext/sodium/libsodium.stub.php index 9a62357f582ca..edf6d5d224126 100644 --- a/ext/sodium/libsodium.stub.php +++ b/ext/sodium/libsodium.stub.php @@ -152,8 +152,7 @@ function sodium_crypto_generichash_keygen(): string {} /** @sensitive-param $key */ function sodium_crypto_generichash_init(string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {} -/** @return true */ -function sodium_crypto_generichash_update(string &$state, string $message): bool {} +function sodium_crypto_generichash_update(string &$state, string $message): true {} function sodium_crypto_generichash_final(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {} diff --git a/ext/sodium/libsodium_arginfo.h b/ext/sodium/libsodium_arginfo.h index 052a95fa18452..411bf5c544951 100644 --- a/ext/sodium/libsodium_arginfo.h +++ b/ext/sodium/libsodium_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d751b690703cb449e249d693d177cdb94087ce82 */ + * Stub hash: ba84ba9ace7a751935d7beead34e3fbb9a511cc7 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -223,7 +223,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_init, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_update, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_update, 0, 2, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 3ecd69a1de173..5020fa4d2897f 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -82,11 +82,9 @@ function stream_wrapper_restore(string $protocol): bool {} function array_push(array &$array, mixed ...$values): int {} -/** @return true */ -function krsort(array &$array, int $flags = SORT_REGULAR): bool {} +function krsort(array &$array, int $flags = SORT_REGULAR): true {} -/** @return true */ -function ksort(array &$array, int $flags = SORT_REGULAR): bool {} +function ksort(array &$array, int $flags = SORT_REGULAR): true {} /** @compile-time-eval */ function count(Countable|array $value, int $mode = COUNT_NORMAL): int {} @@ -98,25 +96,19 @@ function natsort(array &$array): bool {} function natcasesort(array &$array): bool {} -/** @return true */ -function asort(array &$array, int $flags = SORT_REGULAR): bool {} +function asort(array &$array, int $flags = SORT_REGULAR): true {} -/** @return true */ -function arsort(array &$array, int $flags = SORT_REGULAR): bool {} +function arsort(array &$array, int $flags = SORT_REGULAR): true {} -/** @return true */ -function sort(array &$array, int $flags = SORT_REGULAR): bool {} +function sort(array &$array, int $flags = SORT_REGULAR): true {} function rsort(array &$array, int $flags = SORT_REGULAR): bool {} -/** @return true */ -function usort(array &$array, callable $callback): bool {} +function usort(array &$array, callable $callback): true {} -/** @return true */ -function uasort(array &$array, callable $callback): bool {} +function uasort(array &$array, callable $callback): true {} -/** @return true */ -function uksort(array &$array, callable $callback): bool {} +function uksort(array &$array, callable $callback): true {} function end(array|object &$array): mixed {} @@ -139,11 +131,9 @@ function min(mixed $value, mixed ...$values): mixed {} /** @compile-time-eval */ function max(mixed $value, mixed ...$values): mixed {} -/** @return true */ -function array_walk(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {} +function array_walk(array|object &$array, callable $callback, mixed $arg = UNKNOWN): true {} -/** @return true */ -function array_walk_recursive(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {} +function array_walk_recursive(array|object &$array, callable $callback, mixed $arg = UNKNOWN): true {} /** * @compile-time-eval @@ -178,8 +168,7 @@ function array_fill_keys(array $keys, mixed $value): array {} */ function range($start, $end, int|float $step = 1): array {} -/** @return true */ -function shuffle(array &$array): bool {} +function shuffle(array &$array): true {} function array_pop(array &$array): mixed {} @@ -697,11 +686,9 @@ function sha1_file(string $filename, bool $binary = false): string|false {} #ifdef HAVE_SYSLOG_H function openlog(string $prefix, int $flags, int $facility): bool {} -/** @return true */ -function closelog(): bool {} +function closelog(): true {} -/** @return true */ -function syslog(int $priority, string $message): bool {} // TODO make return type void +function syslog(int $priority, string $message): true {} // TODO make return type void #endif #ifdef HAVE_INET_NTOP @@ -1424,8 +1411,7 @@ function getimagesizefromstring(string $string, &$image_info = null): array|fals /* info.c */ -/** @return true */ -function phpinfo(int $flags = INFO_ALL): bool {} // make return type void +function phpinfo(int $flags = INFO_ALL): true {} // make return type void /** * @compile-time-eval @@ -1433,8 +1419,7 @@ function phpinfo(int $flags = INFO_ALL): bool {} // make return type void */ function phpversion(?string $extension = null): string|false {} -/** @return true */ -function phpcredits(int $flags = CREDITS_ALL): bool {} +function phpcredits(int $flags = CREDITS_ALL): true {} /** * @compile-time-eval diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index a34a50f074b6c..0b6881a99bd17 100644 --- 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: 3ce386bb8ab215ad532826e053b8487fd3fd5582 */ + * Stub hash: 90093c63384f7ba56b1c4073b60219cb82843b98 */ 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) @@ -74,7 +74,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_push, 0, 1, IS_LONG, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_krsort, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_krsort, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SORT_REGULAR") ZEND_END_ARG_INFO() @@ -100,9 +100,12 @@ ZEND_END_ARG_INFO() #define arginfo_sort arginfo_krsort -#define arginfo_rsort arginfo_krsort +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rsort, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SORT_REGULAR") +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_usort, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_usort, 0, 2, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() @@ -138,7 +141,7 @@ ZEND_END_ARG_INFO() #define arginfo_max arginfo_min -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, IS_TRUE, 0) ZEND_ARG_TYPE_MASK(1, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, arg, IS_MIXED, 0) @@ -186,7 +189,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_range, 0, 2, IS_ARRAY, 0) ZEND_ARG_TYPE_MASK(0, step, MAY_BE_LONG|MAY_BE_DOUBLE, "1") ZEND_END_ARG_INFO() -#define arginfo_shuffle arginfo_natsort +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shuffle, 0, 1, IS_TRUE, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_pop, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) @@ -708,12 +713,12 @@ ZEND_END_ARG_INFO() #endif #if defined(HAVE_SYSLOG_H) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_closelog, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_closelog, 0, 0, IS_TRUE, 0) ZEND_END_ARG_INFO() #endif #if defined(HAVE_SYSLOG_H) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -1527,7 +1532,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getimagesizefromstring, 0, 1, MA ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_info, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpinfo, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpinfo, 0, 0, IS_TRUE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "INFO_ALL") ZEND_END_ARG_INFO() @@ -1535,7 +1540,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_phpversion, 0, 0, MAY_BE_STRING| ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extension, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpcredits, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpcredits, 0, 0, IS_TRUE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "CREDITS_ALL") ZEND_END_ARG_INFO() diff --git a/sapi/cli/tests/004.phpt b/sapi/cli/tests/004.phpt index 094161a8fafcf..36726f5738af6 100644 --- a/sapi/cli/tests/004.phpt +++ b/sapi/cli/tests/004.phpt @@ -25,7 +25,7 @@ string(155) "Function [ function phpinfo ] { - Parameters [1] { Parameter #0 [ int $flags = INFO_ALL ] } - - Return [ bool ] + - Return [ true ] } "