--TEST--
SPL: RecursiveIteratorIterator and beginChildren/endChildren
--FILE--
\n";
parent::rewind();
}
function beginChildren(): void
{
echo str_repeat(' ',$this->getDepth())."
\n";
}
function endChildren(): void
{
echo str_repeat(' ',$this->getDepth())."
\n";
}
function valid(): bool
{
if (!parent::valid()) {
echo "\n";
return false;
}
return true;
}
}
$arr = array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d");
$obj = new RecursiveArrayIterator($arr);
$rit = new RecursiveArrayIteratorIterator($obj);
foreach($rit as $k=>$v)
{
echo str_repeat(' ',$rit->getDepth()+1)."$k=>$v\n";
}
?>
--EXPECT--