summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>1999-11-14 15:34:50 +0000
committerThies C. Arntzen <thies@php.net>1999-11-14 15:34:50 +0000
commitf2b0c70512108ef86b84aa7e6503211eb7574473 (patch)
tree2a66f53888ae3ec39c2314d785668cedac8fad91 /ext/standard/string.c
parent2327b6b9545f5fc9d35e6d6f242aec8f66b1e27c (diff)
downloadphp-git-f2b0c70512108ef86b84aa7e6503211eb7574473.tar.gz
@- Fixed strtr() not to modify arg1. (Thies)
(PHP strtr) no longer modifies arg1.
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index d208c6ad9b..13a563ff36 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1008,12 +1008,13 @@ PHP_FUNCTION(strtr)
convert_to_string_ex(from);
convert_to_string_ex(to);
- RETVAL_STRING(php_strtr((*str)->value.str.val,
- (*str)->value.str.len,
- (*from)->value.str.val,
- (*to)->value.str.val,
- MIN((*from)->value.str.len,(*to)->value.str.len)),
- 1);
+ *return_value=**str;
+ zval_copy_ctor(return_value);
+ php_strtr(return_value->value.str.val,
+ return_value->value.str.len,
+ (*from)->value.str.val,
+ (*to)->value.str.val,
+ MIN((*from)->value.str.len,(*to)->value.str.len));
}
/* }}} */