summaryrefslogtreecommitdiff
path: root/ext/spl/tests/iterator_036.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/iterator_036.phpt')
-rw-r--r--ext/spl/tests/iterator_036.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/spl/tests/iterator_036.phpt b/ext/spl/tests/iterator_036.phpt
new file mode 100644
index 0000000..9a9e66b
--- /dev/null
+++ b/ext/spl/tests/iterator_036.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SPL: CachingIterator and __toString and flags = 0
+--FILE--
+<?php
+
+function test($it)
+{
+ foreach($it as $v)
+ {
+ var_dump((string)$it);
+ }
+}
+
+$ar = new ArrayIterator(array(1, 2, 3));
+
+test(new CachingIterator($ar, 0));
+
+?>
+===DONE===
+--EXPECTF--
+
+Fatal error: Method CachingIterator::__toString() must not throw an exception in %siterator_036.php on line %d