[php-src] master: ext/standard/basic_functions.c: return bool instead of int for ignore_user_abort()
| From: | Gina Peter Banyard | Date: | Sun, 18 Oct 2026 16:39:07 +0000 |
| Subject: | [php-src] master: ext/standard/basic_functions.c: return bool instead of int for ignore_user_abort() | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142410@lists.php.net to get a copy of this message | ||
Author: Gina Peter Banyard (Girgias)
Date: 2026-10-18T17:39:04+01:00
Commit: https://github.com/php/php-src/commit/fc5cafdec1c428616ac5f3a2ff77b8bc2ee2c234
Raw diff: https://github.com/php/php-src/commit/fc5cafdec1c428616ac5f3a2ff77b8bc2ee2c234.diff
ext/standard/basic_functions.c: return bool instead of int for ignore_user_abort()
The INI setting is stored and displayed as a bool already.
Changed paths:
M ext/standard/basic_functions.c
M ext/standard/basic_functions.stub.php
M ext/standard/basic_functions_arginfo.h
M ext/standard/basic_functions_decl.h
M ext/standard/tests/general_functions/bug72300.phpt
Diff:
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1665feac37df..aa26fb7eae03 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2137,14 +2137,14 @@ PHP_FUNCTION(ignore_user_abort)
{
bool arg = 0;
bool arg_is_null = 1;
- int old_setting;
+ bool old_setting;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL_OR_NULL(arg, arg_is_null)
ZEND_PARSE_PARAMETERS_END();
- old_setting = (unsigned short)PG(ignore_user_abort);
+ old_setting = PG(ignore_user_abort);
if (!arg_is_null) {
zend_string *key = ZSTR_INIT_LITERAL("ignore_user_abort", 0);
@@ -2152,7 +2152,7 @@ PHP_FUNCTION(ignore_user_abort)
zend_string_release_ex(key, 0);
}
- RETURN_LONG(old_setting);
+ RETURN_BOOL(old_setting);
}
/* }}} */
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index 7292122abae4..1d611a8626f7 100644
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -2043,7 +2043,7 @@ function connection_aborted(): int {}
function connection_status(): int {}
-function ignore_user_abort(?bool $enable = null): int {}
+function ignore_user_abort(?bool $enable = null): bool {}
#ifdef HAVE_GETSERVBYNAME
function getservbyname(string $service, string $protocol): int|false {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index 21a14c0bfedf..d8ddb9c541c4 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: 1e7c1c8937b439ecab1343a0e78a6092bcbbb0fc
+ * Stub hash: e2f5310f7044efd270e3c3452a093c95bf244be2
* Has decl header: yes */
#include "zend_attributes.h"
@@ -548,7 +548,7 @@ ZEND_END_ARG_INFO()
#define arginfo_connection_status arginfo_ob_get_level
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ignore_user_abort, 0, 0, IS_LONG, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ignore_user_abort, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null")
ZEND_END_ARG_INFO()
diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h
index e1f012c26370..45b90494086f 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: 1e7c1c8937b439ecab1343a0e78a6092bcbbb0fc */
+ * Stub hash: e2f5310f7044efd270e3c3452a093c95bf244be2 */
-#ifndef ZEND_BASIC_FUNCTIONS_DECL_1e7c1c8937b439ecab1343a0e78a6092bcbbb0fc_H
-#define ZEND_BASIC_FUNCTIONS_DECL_1e7c1c8937b439ecab1343a0e78a6092bcbbb0fc_H
+#ifndef ZEND_BASIC_FUNCTIONS_DECL_e2f5310f7044efd270e3c3452a093c95bf244be2_H
+#define ZEND_BASIC_FUNCTIONS_DECL_e2f5310f7044efd270e3c3452a093c95bf244be2_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_1e7c1c8937b439ecab1343a0e78a6092bcbbb0fc_H */
+#endif /* ZEND_BASIC_FUNCTIONS_DECL_e2f5310f7044efd270e3c3452a093c95bf244be2_H */
diff --git a/ext/standard/tests/general_functions/bug72300.phpt
b/ext/standard/tests/general_functions/bug72300.phpt
index 94d1f20f8ad8..4b82986e134d 100644
--- a/ext/standard/tests/general_functions/bug72300.phpt
+++ b/ext/standard/tests/general_functions/bug72300.phpt
@@ -14,9 +14,9 @@ var_dump(ini_get("ignore_user_abort"));
?>
--EXPECT--
-int(0)
-int(1)
+bool(false)
+bool(true)
string(1) "1"
-int(1)
-int(0)
+bool(true)
+bool(false)
string(1) "0"