spl_iterator_getcallchildren.phpt 725 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. SPL: RecursiveIteratorIterator, getCallChildren
  3. --CREDITS--
  4. Sean Burlington www.practicalweb.co.uk
  5. TestFest London May 2009
  6. --FILE--
  7. <?php
  8. //line 681 ...
  9. $array = array(array(7,8,9),1,2,3,array(4,5,6));
  10. $recursiveArrayIterator = new RecursiveArrayIterator($array);
  11. $test = new RecursiveIteratorIterator($recursiveArrayIterator);
  12. var_dump($test->current());
  13. $test->next();
  14. var_dump($test->current());
  15. try {
  16. $output = $test->callGetChildren();
  17. } catch (InvalidArgumentException $ilae){
  18. $output = null;
  19. print "invalid argument exception\n";
  20. }
  21. var_dump($output);
  22. ?>
  23. ===DONE===
  24. --EXPECTF--
  25. array(3) {
  26. [0]=>
  27. int(7)
  28. [1]=>
  29. int(8)
  30. [2]=>
  31. int(9)
  32. }
  33. int(7)
  34. invalid argument exception
  35. NULL
  36. ===DONE===