1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Fixed #69166 (Assigning array_values() to array does not reset key counter)

This commit is contained in:
Xinchen Hui
2015-03-03 17:07:49 +08:00
parent a78998c48b
commit 70bd500645
2 changed files with 18 additions and 1 deletions

View File

@@ -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)

View File

@@ -0,0 +1,17 @@
--TEST--
Fixed #69166 (Assigning array_values() to array does not reset key counter)
--FILE--
<?php
$array = [0];
$ar = array_values($array);
$ar[] = 1;
var_dump($ar);
?>
--EXPECT--
array(2) {
[0]=>
int(0)
[1]=>
int(1)
}