[php-src] master: Reflection: remove unused indentation support from `_parameter_string()`

Daniel Scherzer <[email protected]> Fri, 17 Jul 2026 18:45:00 +0000
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-07-17T11:40:42-07:00

Commit: https://github.com/php/php-src/commit/d0d7951521c654213922d7ee920a577729def366
Raw diff: https://github.com/php/php-src/commit/d0d7951521c654213922d7ee920a577729def366.diff

Reflection: remove unused indentation support from `_parameter_string()`

While different callers provided different levels of indentation to the
function, the indentation was never used. Remove the parameter and update
callers.

Changed paths:
  M  ext/reflection/php_reflection.c


Diff:

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index f8fef641f6f4..ea577cdea548 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -767,7 +767,7 @@ static void format_default_value(smart_str *str, const zval *value) {
 }
 
 /* {{{ _parameter_string */
-static void _parameter_string(smart_str *str, const zend_function *fptr, const struct _zend_arg_info *arg_info, uint32_t offset, bool required, char* indent)
+static void _parameter_string(smart_str *str, const zend_function *fptr, const struct _zend_arg_info *arg_info, uint32_t offset, bool required)
 {
 	smart_str_append_printf(str, "Parameter #%d [ ", offset);
 	if (!required) {
@@ -829,7 +829,7 @@ static void _function_parameter_string(smart_str *str, const zend_function *fptr
 	smart_str_append_printf(str, "%s- Parameters [%d] {\n", indent, num_args);
 	for (i = 0; i < num_args; i++) {
 		smart_str_append_printf(str, "%s  ", indent);
-		_parameter_string(str, fptr, arg_info, i, i < num_required, indent);
+		_parameter_string(str, fptr, arg_info, i, i < num_required);
 		smart_str_appendc(str, '\n');
 		arg_info++;
 	}
@@ -2671,7 +2671,7 @@ ZEND_METHOD(ReflectionParameter, __toString)
 
 	ZEND_PARSE_PARAMETERS_NONE();
 	GET_REFLECTION_OBJECT_PTR(param);
-	_parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "");
+	_parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required);
 	RETURN_STR(smart_str_extract(&str));
 }