1--TEST--
2HT iterator should be destroyed if array becomes empty during array_splice
3--FILE--
4<?php
5$a=[4];
6$i = 0;
7foreach ($a as &$r) {
8    var_dump($r);
9    $a = array_splice($a, 0);
10    if (++$i == 2) break;
11}
12?>
13--EXPECT--
14int(4)
15int(4)
16