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:
@@ -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--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user