Iterators
| From: | Marc Weber | Date: | Mon, 12 Feb 2007 19:02:30 +0000 |
| Subject: | Iterators | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-248779@lists.php.net to get a copy of this message | ||
<?php
function A()
{
return new RecursiveArrayIterator(array(func_get_args()));
}
$a=iterator_to_array(new RecursiveIteratorIterator( A (A(2) , A (3,4), A(5,6))));
var_dump($a);
?>
I'd expect this to output an array containing 2,3,4,5,6.
But the result is:
array(2) {
[0]=>
int(5)
[1]=>
int(6)
}
What did I miss here?
Marc