summaryrefslogtreecommitdiff
path: root/Zend/tests/try/try_finally_027.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/try/try_finally_027.phpt')
-rw-r--r--Zend/tests/try/try_finally_027.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/Zend/tests/try/try_finally_027.phpt b/Zend/tests/try/try_finally_027.phpt
new file mode 100644
index 0000000000..1e66479eb0
--- /dev/null
+++ b/Zend/tests/try/try_finally_027.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Return in try with throw in finally, inside other finally
+--FILE--
+<?php
+
+function test() {
+ try {
+ throw new Exception(1);
+ } finally {
+ try {
+ return 42;
+ } finally {
+ throw new Exception(2);
+ }
+ }
+}
+
+try {
+ test();
+} catch (Exception $e) {
+ echo $e, "\n";
+}
+
+?>
+--EXPECTF--
+Exception: 1 in %s:%d
+Stack trace:
+#0 %s(%d): test()
+#1 {main}
+
+Next Exception: 2 in %s:%d
+Stack trace:
+#0 %s(%d): test()
+#1 {main}