1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 22:22:18 +02:00
Files
archived-php-src/ext/spl/tests/array_011.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

33 lines
494 B
PHP

--TEST--
SPL: ArrayIterator, LimitIterator and string keys
--FILE--
<?php
$a = array('zero' => 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5);
//foreach (new ArrayIterator($a) as $k => $v)
foreach (new LimitIterator(new ArrayIterator($a), 1, 3) as $k => $v)
{
var_dump(array($k, $v));
}
?>
--EXPECT--
array(2) {
[0]=>
string(3) "one"
[1]=>
int(1)
}
array(2) {
[0]=>
string(3) "two"
[1]=>
int(2)
}
array(2) {
[0]=>
string(5) "three"
[1]=>
int(3)
}