summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 47b1610e28..4ebebacf21 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -774,6 +774,9 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
WRONG_PARAM_COUNT;
}
+ if (PZVAL_IS_REF(*str)) {
+ SEPARATE_ZVAL(str);
+ }
convert_to_string_ex(str);
if (argc > 1) {