summaryrefslogtreecommitdiff
path: root/ext/spl/tests/iterator_036.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/iterator_036.phpt')
-rwxr-xr-xext/spl/tests/iterator_036.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/spl/tests/iterator_036.phpt b/ext/spl/tests/iterator_036.phpt
new file mode 100755
index 000000000..3eb0eefa6
--- /dev/null
+++ b/ext/spl/tests/iterator_036.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SPL: CachingIterator and __toString and flags = 0
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--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