From: Nikita Popov Date: Sun, 25 May 2014 16:19:00 +0000 (+0200) Subject: Fix in_array (strict) with references X-Git-Tag: POST_PHPNG_MERGE~293 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43cf92edf697bea8cf0dcdd6863ee54a0d6cbd09;p=php Fix in_array (strict) with references --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 97ab2583f6..689d083b06 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1165,6 +1165,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{ if (strict) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) { + ZVAL_DEREF(entry); is_identical_function(&res, value, entry TSRMLS_CC); if (Z_TYPE(res) == IS_TRUE) { if (behavior == 0) { diff --git a/ext/standard/tests/array/in_array_with_ref.phpt b/ext/standard/tests/array/in_array_with_ref.phpt new file mode 100644 index 0000000000..2ad3667d23 --- /dev/null +++ b/ext/standard/tests/array/in_array_with_ref.phpt @@ -0,0 +1,14 @@ +--TEST-- +in_array() with references +--FILE-- + +--EXPECT-- +bool(true) +bool(true)