Skip to content

Commit 6deeb54

Browse files
committed
Rename option to error_ignore_args
Per feedback from Tim on the RFC. Also rationalize the default vs. recommended INI settings. This does invert the semantics for the option; the if is changed accordingly.
1 parent e8bd7bf commit 6deeb54

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

Zend/tests/display_error_function_args.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Displaying function arguments in errors
33
--INI--
4-
display_error_function_args=On
4+
error_ignore_args=Off
55
--FILE--
66
<?php
77

@@ -14,7 +14,7 @@ unlink('/');
1414
$flags = ["salt" => "123456789012345678901" . chr(0), "cost" => 4];
1515
password_hash("test", PASSWORD_BCRYPT, $flags);
1616

17-
ini_set("display_error_function_args", "Off");
17+
ini_set("error_ignore_args", "On");
1818

1919
unlink('/');
2020
password_hash("test", PASSWORD_BCRYPT, $flags);

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,8 @@ PHP_INI_BEGIN()
801801

802802
STD_PHP_INI_ENTRY_EX("display_errors", "1", PHP_INI_ALL, OnUpdateDisplayErrors, display_errors, php_core_globals, core_globals, display_errors_mode)
803803
STD_PHP_INI_BOOLEAN("display_startup_errors", "1", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals)
804-
STD_PHP_INI_BOOLEAN("display_error_function_args", "0", PHP_INI_ALL, OnUpdateBool, display_error_function_args, php_core_globals, core_globals)
805804
STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals)
805+
STD_PHP_INI_BOOLEAN("error_ignore_args", "0", PHP_INI_ALL, OnUpdateBool, error_ignore_args, php_core_globals, core_globals)
806806
STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals)
807807
STD_PHP_INI_ENTRY("docref_root", "", PHP_INI_ALL, OnUpdateString, docref_root, php_core_globals, core_globals)
808808
STD_PHP_INI_ENTRY("docref_ext", "", PHP_INI_ALL, OnUpdateString, docref_ext, php_core_globals, core_globals)
@@ -1135,7 +1135,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
11351135
/* if we still have memory then format the origin */
11361136
if (is_function) {
11371137
zend_string *dynamic_params = NULL;
1138-
if (PG(display_error_function_args)) {
1138+
if (PG(error_ignore_args) == false) {
11391139
dynamic_params = zend_trace_current_function_args_string();
11401140
}
11411141
origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, dynamic_params ? ZSTR_VAL(dynamic_params) : params);

main/php_globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct _php_core_globals {
5959

6060
uint8_t display_errors;
6161
bool display_startup_errors;
62-
bool display_error_function_args;
62+
bool error_ignore_args;
6363
bool log_errors;
6464
bool ignore_repeated_errors;
6565
bool ignore_repeated_source;

php.ini-development

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,13 +612,13 @@ ignore_repeated_source = Off
612612
;fatal_error_backtraces = On
613613

614614
; This directive controls whether PHP will print the actual arguments of a
615-
; function upon an error. If disabled (or there was an error fetching the
615+
; function upon an error. If this is on (or there was an error fetching the
616616
; arguments), the function providing the error may optionally provide some
617617
; additional information after the problem function's name.
618618
; Default Value: Off
619-
; Development Value: On
620-
; Production Value: On
621-
display_error_function_args = On
619+
; Development Value: Off
620+
; Production Value: Off
621+
;error_ignore_args = Off
622622

623623
;;;;;;;;;;;;;;;;;
624624
; Data Handling ;

php.ini-production

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,13 @@ ignore_repeated_source = Off
614614
;fatal_error_backtraces = On
615615

616616
; This directive controls whether PHP will print the actual arguments of a
617-
; function upon an error. If disabled (or there was an error fetching the
617+
; function upon an error. If this is on (or there was an error fetching the
618618
; arguments), the function providing the error may optionally provide some
619619
; additional information after the problem function's name.
620620
; Default Value: Off
621-
; Development Value: On
622-
; Production Value: On
623-
display_error_function_args = On
621+
; Development Value: Off
622+
; Production Value: Off
623+
;error_ignore_args = Off
624624

625625
;;;;;;;;;;;;;;;;;
626626
; Data Handling ;

run-tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function main(): void
273273
'fatal_error_backtraces=Off',
274274
'display_errors=1',
275275
'display_startup_errors=1',
276-
'display_error_function_args=0',
276+
'error_ignore_args=1',
277277
'log_errors=0',
278278
'html_errors=0',
279279
'track_errors=0',

0 commit comments

Comments
 (0)