From: Xinchen Hui Date: Sun, 2 Mar 2014 14:07:32 +0000 (+0800) Subject: Fixed str_replace count handling X-Git-Tag: POST_PHPNG_MERGE~412^2~454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92eda10261edf38d53c0134a1ef60aaaeb0755c6;p=php Fixed str_replace count handling --- diff --git a/ext/standard/string.c b/ext/standard/string.c index d484eed022..37a35123e3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3950,8 +3950,8 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL); } if (argc > 3) { - zval_dtor(zcount); - ZVAL_LONG(zcount, count); + zval_dtor(Z_REFVAL_P(zcount)); + ZVAL_LONG(Z_REFVAL_P(zcount), count); } } /* }}} */