diff --git a/main/main.c b/main/main.c index f19f0d8a8df62..04bce9db738ab 100644 --- a/main/main.c +++ b/main/main.c @@ -738,6 +738,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY_EX("display_errors", "1", PHP_INI_ALL, OnUpdateDisplayErrors, display_errors, php_core_globals, core_globals, display_errors_mode) STD_PHP_INI_BOOLEAN("display_startup_errors", "1", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN("display_error_function_args", "0", PHP_INI_ALL, OnUpdateBool, display_error_function_args, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals) STD_PHP_INI_ENTRY("docref_root", "", PHP_INI_ALL, OnUpdateString, docref_root, php_core_globals, core_globals) @@ -1068,7 +1069,13 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ /* if we still have memory then format the origin */ if (is_function) { zend_string *dynamic_params = NULL; - dynamic_params = zend_trace_current_function_args_string(); + /* + * By default, this is disabled because it requires rewriting + * almost all PHPT files. + */ + if (PG(display_error_function_args)) { + dynamic_params = zend_trace_current_function_args_string(); + } origin_len = (int)spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, dynamic_params ? ZSTR_VAL(dynamic_params) : params); if (dynamic_params) { zend_string_release(dynamic_params); diff --git a/main/php_globals.h b/main/php_globals.h index b2f2696c2db2c..1490e579a09d0 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -61,6 +61,7 @@ struct _php_core_globals { uint8_t display_errors; bool display_startup_errors; + bool display_error_function_args; bool log_errors; bool ignore_repeated_errors; bool ignore_repeated_source;