diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index afa3602fae1..30e0453f26b 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -795,7 +795,7 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, #define ZEND_HASH_FILL_END() \ __fill_ht->nNumUsed = __fill_idx; \ __fill_ht->nNumOfElements = __fill_idx; \ - __fill_ht->nNextFreeElement = __fill_idx + 1; \ + __fill_ht->nNextFreeElement = __fill_idx; \ __fill_ht->nInternalPointer = 0; \ } while (0) diff --git a/ext/standard/tests/array/bug69166.phpt b/ext/standard/tests/array/bug69166.phpt new file mode 100644 index 00000000000..d0b5fadd6d8 --- /dev/null +++ b/ext/standard/tests/array/bug69166.phpt @@ -0,0 +1,17 @@ +--TEST-- +Fixed #69166 (Assigning array_values() to array does not reset key counter) +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + int(0) + [1]=> + int(1) +}