iterator_036.phpt 367 B

12345678910111213141516171819202122
  1. --TEST--
  2. SPL: CachingIterator and __toString and flags = 0
  3. --FILE--
  4. <?php
  5. function test($it)
  6. {
  7. foreach($it as $v)
  8. {
  9. var_dump((string)$it);
  10. }
  11. }
  12. $ar = new ArrayIterator(array(1, 2, 3));
  13. test(new CachingIterator($ar, 0));
  14. ?>
  15. ===DONE===
  16. --EXPECTF--
  17. Fatal error: Method CachingIterator::__toString() must not throw an exception in %siterator_036.php on line %d