summaryrefslogtreecommitdiff
path: root/Zend/tests/bug53511.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug53511.phpt')
-rw-r--r--Zend/tests/bug53511.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/Zend/tests/bug53511.phpt b/Zend/tests/bug53511.phpt
new file mode 100644
index 0000000000..88f0cbe8f4
--- /dev/null
+++ b/Zend/tests/bug53511.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #53511 (Exceptions are lost in case an exception is thrown in catch operator)
+--FILE--
+<?php
+class Foo {
+ function __destruct() {
+ throw new Exception("ops 1");
+ }
+}
+
+function test() {
+ $e = new Foo();
+ try {
+ throw new Exception("ops 2");
+ } catch (Exception $e) {
+ echo $e->getMessage()."\n";
+ }
+}
+
+test();
+echo "bug\n";
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' with message 'ops 2' in %sbug53511.php:11
+Stack trace:
+#0 %sbug53511.php(17): test()
+#1 {main}
+
+Next exception 'Exception' with message 'ops 1' in %sbug53511.php:4
+Stack trace:
+#0 %sbug53511.php(12): Foo->__destruct()
+#1 %sbug53511.php(17): test()
+#2 {main}
+ thrown in %sbug53511.php on line 4