]> granicus.if.org Git - php/commitdiff
- type is either 1 or 2 if second parameter is set. if not set then type
authorAndrey Hristov <andrey@php.net>
Sat, 12 Mar 2005 13:08:19 +0000 (13:08 +0000)
committerAndrey Hristov <andrey@php.net>
Sat, 12 Mar 2005 13:08:19 +0000 (13:08 +0000)
is 0.
- use the lvalue for the second rvalue

ext/standard/string.c

index 43ac7822af9ecad486a970812050ea6c1416c9b0..4052cf0b13fe72b98ed54415f89776dd5343d9f9 100644 (file)
@@ -4678,10 +4678,9 @@ PHP_FUNCTION(str_word_count)
 
        convert_to_string_ex(str);
        
-       p = s = Z_STRVAL_PP(str);
-       e = Z_STRVAL_PP(str) + Z_STRLEN_PP(str);
+       e = Z_STRLEN_PP(str) + (p = s = Z_STRVAL_PP(str));
                
-       if (type == 1 || type == 2) {
+       if (type) {
                array_init(return_value);
        }