summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_iterator_apply_error_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/spl_iterator_apply_error_001.phpt')
-rw-r--r--ext/spl/tests/spl_iterator_apply_error_001.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_iterator_apply_error_001.phpt b/ext/spl/tests/spl_iterator_apply_error_001.phpt
new file mode 100644
index 0000000..54663c0
--- /dev/null
+++ b/ext/spl/tests/spl_iterator_apply_error_001.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SPL: Error: iterator_apply when the callback throws an exception
+--FILE--
+<?php
+
+function test() {
+ throw new Exception('Broken callback');
+}
+
+$it = new RecursiveArrayIterator(array(1, 21, 22));
+
+try {
+ iterator_apply($it, 'test');
+} catch (Exception $e) {
+ echo $e->getMessage();
+}
+
+?>
+--EXPECT--
+Broken callback