mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
9a9eed472b
When a HT iterator is one past the end and we rehash, we need to make sure that it is move to the new one past the end position, to make sure that newly inserted elements are picked up.
19 lines
262 B
PHP
19 lines
262 B
PHP
--TEST--
|
|
Perform a packed to hash insert when the iterator is at the end of the array
|
|
--FILE--
|
|
|
|
<?php
|
|
$a = [];
|
|
$a[1] = 1;
|
|
foreach ($a as $k => &$v) {
|
|
var_dump($v);
|
|
if ($k == 1) $a[4] = 4;
|
|
if ($k == 4) $a[2] = 2;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|
|
int(4)
|
|
int(2)
|