diff --git a/NEWS b/NEWS index 5ca72be50643..0817b78f6598 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.6.0beta2 +?? ??? ????, PHP 8.6.0beta3 + + +27 Aug 2026, PHP 8.6.0beta2 - Core: . Fixed bug GH-15375 (Nested "yield from" skips items after a valid() or diff --git a/UPGRADING b/UPGRADING index 4a5d055a57c4..f3b4ed8b99fa 100644 --- a/UPGRADING +++ b/UPGRADING @@ -652,6 +652,12 @@ PHP 8.6 UPGRADE NOTES - Phar: . Phar::mungServer() now supports reference values. +- Readline: + . readline_completion_function() now declares true as its return type. The + function assigns a static callback and then tests whether the assignment + landed, which is a tautology; an invalid callback throws a TypeError via + ZPP before the function body is reached. + - Sockets: . socket_addrinfo_lookup() now has an additional optional argument $error when not null, and on failure, gives the error code (one of the EAI_* @@ -664,6 +670,9 @@ PHP 8.6 UPGRADE NOTES . 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. + . register_tick_function() now declares true as its return type. It has + always returned true on success; an invalid callback throws a TypeError + via ZPP before the function body is reached. . 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/readline/readline.c b/ext/readline/readline.c index cbc0ebdd8713..d9ec274996c7 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -489,8 +489,8 @@ PHP_FUNCTION(readline_completion_function) /* NOTE: The rl_attempted_completion_function variable (and others) are part of the readline library, not php */ rl_attempted_completion_function = php_readline_completion_cb; - - RETURN_BOOL(rl_attempted_completion_function != NULL); + + RETURN_TRUE; } /* }}} */ diff --git a/ext/readline/readline.stub.php b/ext/readline/readline.stub.php index be445df21415..4dae1237c605 100644 --- a/ext/readline/readline.stub.php +++ b/ext/readline/readline.stub.php @@ -29,7 +29,7 @@ function readline_read_history(?string $filename = null): bool {} function readline_write_history(?string $filename = null): bool {} -function readline_completion_function(callable $callback): bool {} +function readline_completion_function(callable $callback): true {} #ifdef HAVE_RL_CALLBACK_READ_CHAR diff --git a/ext/readline/readline_arginfo.h b/ext/readline/readline_arginfo.h index 689d5f762eef..1ce08c443eeb 100644 --- a/ext/readline/readline_arginfo.h +++ b/ext/readline/readline_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit readline.stub.php instead. - * Stub hash: 7a314f75d9a89a9ea4d525515bb6bacdf7be6746 */ + * Stub hash: 848e798481f62ee09cfd8cc3dfa6b0814cfdd979 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readline, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prompt, IS_STRING, 1, "null") @@ -28,7 +28,7 @@ ZEND_END_ARG_INFO() #define arginfo_readline_write_history arginfo_readline_read_history -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_completion_function, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_completion_function, 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.stub.php b/ext/standard/basic_functions.stub.php index 42cb711512b8..3e23934cbc78 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -2063,7 +2063,7 @@ function getprotobyname(string $protocol): int|false {} function getprotobynumber(int $protocol): string|false {} #endif -function register_tick_function(callable $callback, mixed ...$args): bool {} +function register_tick_function(callable $callback, mixed ...$args): true {} function unregister_tick_function(callable $callback): void {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index a057d3d48be3..442085e9d6cc 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 basic_functions.stub.php instead. - * Stub hash: 13b6fd340958d1a7c782c8f5f3685517e62e5edc + * Stub hash: c645e310c00d9f4cb3856c94ee60d06071e28de0 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -574,7 +574,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getprotobynumber, 0, 1, MAY_BE_S ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_tick_function, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_tick_function, 0, 1, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index ab0a8ec94f7b..f2f234f60cc2 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: 13b6fd340958d1a7c782c8f5f3685517e62e5edc */ + * Stub hash: c645e310c00d9f4cb3856c94ee60d06071e28de0 */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H -#define ZEND_BASIC_FUNCTIONS_DECL_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_c645e310c00d9f4cb3856c94ee60d06071e28de0_H +#define ZEND_BASIC_FUNCTIONS_DECL_c645e310c00d9f4cb3856c94ee60d06071e28de0_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_13b6fd340958d1a7c782c8f5f3685517e62e5edc_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_c645e310c00d9f4cb3856c94ee60d06071e28de0_H */