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:
@@ -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)
|
||||
|
||||
|
||||
17
ext/standard/tests/array/bug69166.phpt
Normal file
17
ext/standard/tests/array/bug69166.phpt
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user