ZEND_PARSE_PARAMETERS_END();
if (strict) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
- ZVAL_DEREF(entry);
- if (fast_is_identical_function(value, entry)) {
- if (behavior == 0) {
- RETURN_TRUE;
- } else {
- if (str_idx) {
- RETVAL_STR_COPY(str_idx);
+ if (Z_TYPE_P(value) == IS_LONG) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
+ ZVAL_DEREF(entry);
+ if (Z_TYPE_P(entry) == IS_LONG && Z_LVAL_P(entry) == Z_LVAL_P(value)) {
+ if (behavior == 0) {
+ RETURN_TRUE;
} else {
- RETVAL_LONG(num_idx);
+ if (str_idx) {
+ RETVAL_STR_COPY(str_idx);
+ } else {
+ RETVAL_LONG(num_idx);
+ }
+ return;
}
- return;
}
- }
- } ZEND_HASH_FOREACH_END();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
+ ZVAL_DEREF(entry);
+ if (fast_is_identical_function(value, entry)) {
+ if (behavior == 0) {
+ RETURN_TRUE;
+ } else {
+ if (str_idx) {
+ RETVAL_STR_COPY(str_idx);
+ } else {
+ RETVAL_LONG(num_idx);
+ }
+ return;
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ }
} else {
if (Z_TYPE_P(value) == IS_LONG) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {