[php-src] master: ext/standard: declare true as the return type of register_tick_function() (#23432)

Louis-Arnaud via GitHub <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: kocsismate
Date: 2026-08-25T16:54:42+02:00

Commit: https://github.com/php/php-src/commit/1f2bcb87557f3bb86b3641ffc60874fc3b05d170
Raw diff: https://github.com/php/php-src/commit/1f2bcb87557f3bb86b3641ffc60874fc3b05d170.diff

ext/standard: declare true as the return type of register_tick_function() (#23432)

The function either throws on an invalid callback or appends the entry
to the tick list and returns true; php_add_tick_function() returns void,
so there is nothing that could report a failure.

Changed paths:
  M  UPGRADING
  M  ext/standard/basic_functions.stub.php
  M  ext/standard/basic_functions_arginfo.h
  M  ext/standard/basic_functions_decl.h


Diff:

diff --git a/UPGRADING b/UPGRADING
index 4a5d055a57c4..f015399f645e 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -664,6 +664,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/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 */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.