Skip to content

Commit 3890c8b

Browse files
kabelkrakjoe
authored andcommitted
Fix bug 76596: phpdbg supports display_errors=stderr
1 parent cbc5a14 commit 3890c8b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ PHP NEWS
4545
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
4646
failure). (Nikita)
4747

48+
- phpdbg:
49+
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
50+
4851
- Sockets:
4952
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
5053
on MacOS). (Michael Meyer)

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static PHP_INI_DISP(display_errors_mode)
395395
mode = php_get_display_errors_mode(tmp_value, tmp_value_length);
396396

397397
/* Display 'On' for other SAPIs instead of STDOUT or STDERR */
398-
cgi_or_cli = (!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi"));
398+
cgi_or_cli = (!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi") || !strcmp(sapi_module.name, "phpdbg"));
399399

400400
switch (mode) {
401401
case PHP_DISPLAY_ERRORS_STDERR:
@@ -1181,7 +1181,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
11811181
}
11821182
} else {
11831183
/* Write CLI/CGI errors to stderr if display_errors = "stderr" */
1184-
if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")) &&
1184+
if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi") || !strcmp(sapi_module.name, "phpdbg")) &&
11851185
PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR
11861186
) {
11871187
fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);

0 commit comments

Comments
 (0)