From ba43f3c64d5748cf025729e4d415b6d71d42ff7e Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Sat, 22 Aug 2026 00:47:49 +0800 Subject: [PATCH 1/2] [skip ci] UPGRADING: Add an entry for #23395 Since commit a183f11 has an UPGRADING entry, for the sake of consistency let's also add an UPGRADING entry for #23395 --- UPGRADING | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UPGRADING b/UPGRADING index 5054e0a4d81f..b2c488220f20 100644 --- a/UPGRADING +++ b/UPGRADING @@ -620,6 +620,10 @@ PHP 8.6 UPGRADE NOTES directive (or null if it has none), independent of values set in php.ini, on the command line, or at runtime. +- Zip: + . zip_entry_close() return type has been narrowed from bool to true. The + function already always returned true. + ======================================== 6. New Functions ======================================== From f89291a94f8ee886b2d5da6851726f846e351bed Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Fri, 21 Aug 2026 21:58:21 +0200 Subject: [PATCH 2/2] ext/standard: declare true as the return type of header_register_callback() (#23402) The function has a single non-throwing exit, RETURN_TRUE (main/SAPI.c). The false return disappeared in PHP 8.0.0: until then an invalid callback was rejected with RETURN_FALSE, whereas the zend_parse_parameters() 'f' specifier introduced there throws a TypeError. Registering a callback after the headers have been sent, the one case where the callback is knowingly discarded, also returns true. ksort(), asort() and natsort() already declare true in the same stub. --- UPGRADING | 3 +++ ext/standard/basic_functions.stub.php | 2 +- ext/standard/basic_functions_arginfo.h | 4 ++-- ext/standard/basic_functions_decl.h | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/UPGRADING b/UPGRADING index b2c488220f20..d8fc594e82f8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -615,6 +615,9 @@ PHP 8.6 UPGRADE NOTES returned. - Standard: + . header_register_callback() now declares true as its return type. It has not + been able to return false since PHP 8.0.0, where passing an invalid + callback started throwing a TypeError instead. . ini_get_all() now includes a "builtin_default_value" element for each directive when $details is true. It holds the built-in default value of the directive (or null if it has none), independent of values set in php.ini, diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index c87e22433400..42cb711512b8 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1505,7 +1505,7 @@ function set_time_limit(int $seconds): bool {} /* main/SAPI.c */ -function header_register_callback(callable $callback): bool {} +function header_register_callback(callable $callback): true {} /* main/output.c */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index ab8c57d4e8d9..a057d3d48be3 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,12 +1,12 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: cf2ea35cd867f7091ee1fcf83bbfb543b51e5786 + * Stub hash: 13b6fd340958d1a7c782c8f5f3685517e62e5edc * Has decl header: yes */ 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) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_register_callback, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_register_callback, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index 02203be0df41..ab0a8ec94f7b 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: cf2ea35cd867f7091ee1fcf83bbfb543b51e5786 */ + * Stub hash: 13b6fd340958d1a7c782c8f5f3685517e62e5edc */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_cf2ea35cd867f7091ee1fcf83bbfb543b51e5786_H -#define ZEND_BASIC_FUNCTIONS_DECL_cf2ea35cd867f7091ee1fcf83bbfb543b51e5786_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H +#define ZEND_BASIC_FUNCTIONS_DECL_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H typedef enum zend_enum_SortDirection { ZEND_ENUM_SortDirection_Ascending = 1, @@ -20,4 +20,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_cf2ea35cd867f7091ee1fcf83bbfb543b51e5786_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H */