File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
spl /
tests /
recursiveiteratoriterator_getsubiterator_variation.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
SPL: RecursiveIteratorIterator::getSubIterator() returns different iterators depending on the current element
--CREDITS--
Matt Raines matt@raines.me.uk
#testfest London 2009-05-09
--FILE--
<?php
$sample_array = array(1, 2, array(3, 4));
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($sample_array));
$iterator->next();
$iterator->next();
var_dump(get_class($iterator->getSubIterator()));
var_dump($iterator->getSubIterator()->getArrayCopy());
$iterator->next();
var_dump(get_class($iterator->getSubIterator()));
var_dump($iterator->getSubIterator()->getArrayCopy());
?>
--EXPECTF--
%unicode|string%(22) "RecursiveArrayIterator"
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
array(2) {
[0]=>
int(3)
[1]=>
int(4)
}
}
%unicode|string%(22) "RecursiveArrayIterator"
array(2) {
[0]=>
int(3)
[1]=>
int(4)
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>