Commit d52b81e3081 for php.net
commit d52b81e3081ac4dbc79e748a97586852ed73f1c6
Merge: 39e45a34064 cc0ff7e0a05
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Fri Jul 31 12:13:41 2026 -0400
Merge branch 'PHP-8.5'
* PHP-8.5:
Avoid truncation on null bytes in class and function names
diff --cc ext/reflection/php_reflection.c
index 2bd8018ab6a,94f90842889..588e139810b
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -923,13 -963,14 +923,14 @@@ static void _function_string(smart_str
smart_str_appends(str, "function ");
}
- if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
+ if (fptr->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
smart_str_appendc(str, '&');
}
- smart_str_append_printf(str, "%s ] {\n", ZSTR_VAL(fptr->common.function_name));
+ smart_str_append(str, fptr->common.function_name);
+ smart_str_appends(str, " ] {\n");
/* The information where a function is declared is only available for user classes */
if (fptr->type == ZEND_USER_FUNCTION) {
- smart_str_append_printf(str, "%s @@ %s %d - %d\n", indent,
+ smart_str_append_printf(str, "%s @@ %s %" PRIu32 " - %" PRIu32 "\n", indent,
ZSTR_VAL(fptr->op_array.filename),
fptr->op_array.line_start,
fptr->op_array.line_end);