1--TEST--
2SPL: FixedArray: change array size during iteration
3--FILE--
4<?php
5
6$splFixedArray = SplFixedArray::fromArray(["a","b","c"]);
7/* Try changing size on first, second, and final iterations, and check what
8 * happens in each case */
9foreach ($splFixedArray as $k => $v) {
10  echo "$k => $v\n";
11  if ($k == 0) {
12    $splFixedArray->setSize(2);
13  }
14}
15echo "---\n";
16
17$splFixedArray = SplFixedArray::fromArray(["a","b","c"]);
18foreach ($splFixedArray as $k => $v) {
19  echo "$k => $v\n";
20  if ($k == 1) {
21    $splFixedArray->setSize(2);
22  }
23}
24echo "---\n";
25
26$splFixedArray = SplFixedArray::fromArray(["a","b","c"]);
27foreach ($splFixedArray as $k => $v) {
28  echo "$k => $v\n";
29  if ($k == 2) {
30    $splFixedArray->setSize(2);
31  }
32}
33echo "\n";
34--EXPECT--
350 => a
361 => b
37---
380 => a
391 => b
40---
410 => a
421 => b
432 => c
44