Skip to content

Commit 7b572f2

Browse files
committed
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.
1 parent e5edab2 commit 7b572f2

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

ext/standard/basic_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,22 +2113,22 @@ PHP_FUNCTION(ignore_user_abort)
21132113
{
21142114
bool arg = 0;
21152115
bool arg_is_null = 1;
2116-
int old_setting;
2116+
bool old_setting;
21172117

21182118
ZEND_PARSE_PARAMETERS_START(0, 1)
21192119
Z_PARAM_OPTIONAL
21202120
Z_PARAM_BOOL_OR_NULL(arg, arg_is_null)
21212121
ZEND_PARSE_PARAMETERS_END();
21222122

2123-
old_setting = (unsigned short)PG(ignore_user_abort);
2123+
old_setting = PG(ignore_user_abort);
21242124

21252125
if (!arg_is_null) {
21262126
zend_string *key = ZSTR_INIT_LITERAL("ignore_user_abort", 0);
21272127
zend_alter_ini_entry_chars(key, arg ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
21282128
zend_string_release_ex(key, 0);
21292129
}
21302130

2131-
RETURN_LONG(old_setting);
2131+
RETURN_BOOL(old_setting);
21322132
}
21332133
/* }}} */
21342134

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ function connection_aborted(): int {}
20392039

20402040
function connection_status(): int {}
20412041

2042-
function ignore_user_abort(?bool $enable = null): int {}
2042+
function ignore_user_abort(?bool $enable = null): bool {}
20432043

20442044
#ifdef HAVE_GETSERVBYNAME
20452045
function getservbyname(string $service, string $protocol): int|false {}

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/standard/basic_functions_decl.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/standard/tests/general_functions/bug72300.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ var_dump(ini_get("ignore_user_abort"));
1414

1515
?>
1616
--EXPECT--
17-
int(0)
18-
int(1)
17+
bool(false)
18+
bool(true)
1919
string(1) "1"
20-
int(1)
21-
int(0)
20+
bool(true)
21+
bool(false)
2222
string(1) "0"

0 commit comments

Comments
 (0)