]> granicus.if.org Git - php/commitdiff
Fix #24281 - str_replace not updating the count if value is
authorStanislav Malyshev <stas@php.net>
Mon, 23 Jun 2003 14:09:14 +0000 (14:09 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 23 Jun 2003 14:09:14 +0000 (14:09 +0000)
not initialized

ext/standard/string.c

index 46194042c9ebd13eba9bc94d1d5d7f91d7e97f6c..3203675120c7ec3aba2670ee2c69810731be5fde 100644 (file)
@@ -3194,7 +3194,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) {
-               Z_LVAL_PP(zcount) = count;
+               zval_dtor(*zcount);
+               ZVAL_LONG(*zcount, count);
        }
 }
 /* }}} */