Iterators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




<?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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux