summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index fff25c077e..1d193768e3 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2728,6 +2728,7 @@ PHP_FUNCTION(str_replace)
while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) {
if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) {
MAKE_STD_ZVAL(result);
+ SEPARATE_ZVAL(subject_entry);
php_str_replace_in_subject(*search, *replace, subject_entry, result);
} else {
result = *subject_entry;