xref: /PHP-5.6/ext/spl/tests/array_011.phpt (revision 610c7fbe)
1--TEST--
2SPL: ArrayIterator, LimitIterator and string keys
3--FILE--
4<?php
5
6$a = array('zero' => 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5);
7//foreach (new ArrayIterator($a) as $k => $v)
8foreach (new LimitIterator(new ArrayIterator($a), 1, 3) as $k => $v)
9{
10	var_dump(array($k, $v));
11}
12
13?>
14===DONE===
15<?php exit(0); ?>
16--EXPECT--
17array(2) {
18  [0]=>
19  string(3) "one"
20  [1]=>
21  int(1)
22}
23array(2) {
24  [0]=>
25  string(3) "two"
26  [1]=>
27  int(2)
28}
29array(2) {
30  [0]=>
31  string(5) "three"
32  [1]=>
33  int(3)
34}
35===DONE===
36