From: Thies C. Arntzen Date: Sun, 14 Nov 1999 15:34:50 +0000 (+0000) Subject: @- Fixed strtr() not to modify arg1. (Thies) X-Git-Tag: php-4.0b3_RC5~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2b0c70512108ef86b84aa7e6503211eb7574473;p=php @- Fixed strtr() not to modify arg1. (Thies) (PHP strtr) no longer modifies arg1. --- 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)); } /* }}} */