summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_021.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/closure_021.phpt')
-rw-r--r--Zend/tests/closure_021.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/closure_021.phpt b/Zend/tests/closure_021.phpt
new file mode 100644
index 0000000..76be762
--- /dev/null
+++ b/Zend/tests/closure_021.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Closure 021: Throwing exception inside lambda
+--FILE--
+<?php
+
+$foo = function() {
+ try {
+ throw new Exception('test!');
+ } catch(Exception $e) {
+ throw $e;
+ }
+};
+
+try {
+ $foo();
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+?>
+--EXPECT--
+string(5) "test!"