]> granicus.if.org Git - php/commitdiff
Fix bug 13567 and don't depend on a boolean int-value to be either 1 or 0
authorJeroen van Wolffelaar <jeroen@php.net>
Fri, 5 Oct 2001 20:14:33 +0000 (20:14 +0000)
committerJeroen van Wolffelaar <jeroen@php.net>
Fri, 5 Oct 2001 20:14:33 +0000 (20:14 +0000)
ext/standard/array.c

index 156511a27ef329e1f4b70fc2077ed6e100bd57fd..922f9cf3b98e363689164ab5b00dea754882c4f1 100644 (file)
@@ -1071,7 +1071,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
        zend_hash_internal_pointer_reset_ex(target_hash, &pos);
        while(zend_hash_get_current_data_ex(target_hash, (void **)&entry, &pos) == SUCCESS) {
        compare_func(&res, *value, *entry TSRMLS_CC);
-               if (Z_LVAL(res) == 1) {
+               if (Z_LVAL(res)) {
                        if (behavior==0) {           
                                RETURN_TRUE;
                        } else {
@@ -1090,11 +1090,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
                zend_hash_move_forward_ex(target_hash, &pos);
        }
    
-       if (behavior == 0) {
-               RETURN_FALSE;
-       } else { 
-               return;
-       }
+       RETURN_FALSE;
 }