2004-08-31 20:54:31 +00:00
|
|
|
--TEST--
|
2004-10-31 18:43:00 +00:00
|
|
|
SPL: ArrayItaerator/Object and IteratorIterator
|
2004-08-31 20:54:31 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("spl")) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
2004-10-31 18:43:00 +00:00
|
|
|
$it = new ArrayIterator(range(0,3));
|
2004-08-31 20:54:31 +00:00
|
|
|
|
2004-10-31 18:43:00 +00:00
|
|
|
foreach(new IteratorIterator($it) as $v)
|
|
|
|
{
|
|
|
|
var_dump($v);
|
|
|
|
}
|
|
|
|
|
|
|
|
$it = new ArrayObject(range(0,3));
|
|
|
|
|
|
|
|
foreach(new IteratorIterator($it) as $v)
|
2004-08-31 20:54:31 +00:00
|
|
|
{
|
|
|
|
var_dump($v);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
===DONE===
|
|
|
|
<?php exit(0); ?>
|
|
|
|
--EXPECTF--
|
|
|
|
int(0)
|
2004-10-31 18:43:00 +00:00
|
|
|
int(1)
|
|
|
|
int(2)
|
|
|
|
int(3)
|
2004-08-31 20:54:31 +00:00
|
|
|
int(0)
|
|
|
|
int(1)
|
|
|
|
int(2)
|
|
|
|
int(3)
|
|
|
|
===DONE===
|