Skip to content

Commit b6cc544

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 dd0156e commit b6cc544

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

ext/standard/basic_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,22 +2106,22 @@ PHP_FUNCTION(ignore_user_abort)
21062106
{
21072107
bool arg = 0;
21082108
bool arg_is_null = 1;
2109-
int old_setting;
2109+
bool old_setting;
21102110

21112111
ZEND_PARSE_PARAMETERS_START(0, 1)
21122112
Z_PARAM_OPTIONAL
21132113
Z_PARAM_BOOL_OR_NULL(arg, arg_is_null)
21142114
ZEND_PARSE_PARAMETERS_END();
21152115

2116-
old_setting = (unsigned short)PG(ignore_user_abort);
2116+
old_setting = PG(ignore_user_abort);
21172117

21182118
if (!arg_is_null) {
21192119
zend_string *key = ZSTR_INIT_LITERAL("ignore_user_abort", 0);
21202120
zend_alter_ini_entry_chars(key, arg ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
21212121
zend_string_release_ex(key, 0);
21222122
}
21232123

2124-
RETURN_LONG(old_setting);
2124+
RETURN_BOOL(old_setting);
21252125
}
21262126
/* }}} */
21272127

ext/standard/basic_functions.stub.php

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

20212021
function connection_status(): int {}
20222022

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

20252025
#ifdef HAVE_GETSERVBYNAME
20262026
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/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)