1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Make return type of trigger_error() and user_error() true (#13169)

This commit is contained in:
Niels Dossche
2024-01-17 17:15:55 +01:00
committed by GitHub
parent 45f8cfaf10
commit dcd2a0dde6
3 changed files with 8 additions and 4 deletions

View File

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

View File

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

View File

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