xref: /php-src/Zend/tests/foreach/foreach_016.phpt (revision 275f63e7)
1--TEST--
2array_unshift() function preserve foreach by reference iterator pointer
3--FILE--
4<?php
5$a = [1,2,3];
6foreach($a as &$v) {
7    echo "$v\n";
8    if ($v == 2) {
9        array_unshift($a, 0, 0, 0, 0, 0, 0, 0, 0);
10    }
11}
12var_dump(count($a));
13?>
14--EXPECT--
151
162
173
18int(11)
19