summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-10-05 20:14:33 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-10-05 20:14:33 +0000
commit89ea50a58843076b1831a90d8813cf4c51d8fde9 (patch)
tree070503c1d52e561ccddba3dfa2255f4fbbc33b4f /ext/standard/array.c
parente78b61542d7549c994bfa8e94168611ec65beb57 (diff)
downloadphp-git-89ea50a58843076b1831a90d8813cf4c51d8fde9.tar.gz
Fix bug 13567 and don't depend on a boolean int-value to be either 1 or 0
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 156511a27e..922f9cf3b9 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -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;
}