summaryrefslogtreecommitdiff
path: root/Zend/tests/foreach_by_ref_repacking_insert.phpt
blob: 1a2f9c7068b6d36dd49ae4dada844e37f6692f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--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)