1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 03:32:20 +02:00

Fixed COUNT_RECURSIVE reference handling

This commit is contained in:
Xinchen Hui
2014-03-17 22:04:54 +08:00
parent 77f4c94114
commit 3203c65c7c

View File

@@ -288,6 +288,9 @@ static int php_count_recursive(zval *array, long mode TSRMLS_DC) /* {{{ */
zend_hash_move_forward_ex(Z_ARRVAL_P(array), &pos)
) {
Z_ARRVAL_P(array)->nApplyCount++;
if (Z_TYPE_P(element) == IS_REFERENCE) {
element = Z_REFVAL_P(element);
}
cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC);
Z_ARRVAL_P(array)->nApplyCount--;
}