From 0a959fbe1c30e6497b4b0eff19879e81a4c2e6f6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:37:17 +0100 Subject: [PATCH] Make return type of trigger_error() and user_error() true --- UPGRADING | 4 ++++ Zend/zend_builtin_functions.stub.php | 4 ++-- Zend/zend_builtin_functions_arginfo.h | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/UPGRADING b/UPGRADING index a182ce654e17a..66d7411dd1b39 100644 --- a/UPGRADING +++ b/UPGRADING @@ -267,6 +267,10 @@ PDO_SQLITE: 5. Changed Functions ======================================== +- Core: + . trigger_error() and user_error() now have a return type of true instead of + bool. + - DOM: . DOMDocument::registerNodeClass() now has a tentative return type of true. Previously, the return type was bool but only true could be returned in practice. diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index 6ecbaa93526e6..b6740523d5000 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -95,10 +95,10 @@ function get_included_files(): array {} */ function get_required_files(): array {} -function trigger_error(string $message, int $error_level = E_USER_NOTICE): bool {} +function trigger_error(string $message, int $error_level = E_USER_NOTICE): true {} /** @alias trigger_error */ -function user_error(string $message, int $error_level = E_USER_NOTICE): bool {} +function user_error(string $message, int $error_level = E_USER_NOTICE): true {} /** @return callable|null */ function set_error_handler(?callable $callback, int $error_levels = E_ALL) {} diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index aa28fd47bd284..636eba6188585 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: 12899073f3791c5da31aa555c0e612ee1faadf55 */ + * Stub hash: bd3226bdeb5585333f97659a0a3b01504d830a15 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -127,7 +127,7 @@ ZEND_END_ARG_INFO() #define arginfo_get_required_files arginfo_func_get_args -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trigger_error, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trigger_error, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_level, IS_LONG, 0, "E_USER_NOTICE") ZEND_END_ARG_INFO()