iterator_to_array.phpt 608 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. SPL: iterator_to_array() exceptions test
  3. --CREDITS--
  4. Lance Kesson jac_kesson@hotmail.com
  5. #testfest London 2009-05-09
  6. --FILE--
  7. <?php
  8. $array=array('a','b');
  9. $iterator = new ArrayIterator($array);
  10. iterator_to_array();
  11. iterator_to_array($iterator,'test','test');
  12. iterator_to_array('test','test');
  13. ?>
  14. --EXPECTF--
  15. Warning: iterator_to_array() expects at least 1 parameter, 0 given in %s
  16. Warning: iterator_to_array() expects at most 2 parameters, 3 given in %s
  17. Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, %unicode_string_optional% given %s