1--TEST--
2Perform a packed to hash insert when the iterator is at the end of the array
3--FILE--
4
5<?php
6$a = [];
7$a[1] = 1;
8foreach ($a as $k => &$v) {
9    var_dump($v);
10    if ($k == 1) $a[4] = 4;
11    if ($k == 4) $a[2] = 2;
12}
13
14?>
15--EXPECT--
16int(1)
17int(4)
18int(2)
19