summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/tests/bug70944.phpt33
1 files changed, 27 insertions, 6 deletions
diff --git a/Zend/tests/bug70944.phpt b/Zend/tests/bug70944.phpt
index f14af65166..192fd6d501 100644
--- a/Zend/tests/bug70944.phpt
+++ b/Zend/tests/bug70944.phpt
@@ -2,15 +2,36 @@
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
-$e = new Exception("Bar");
try {
- throw new Exception("Foo", 0, $e);
-} finally {
- throw $e;
+ $e = new Exception("Foo");
+ try {
+ throw new Exception("Bar", 0, $e);
+ } finally {
+ throw $e;
+ }
+} catch (Exception $e) {
+ var_dump((string)$e);
+}
+
+try {
+ $e = new Exception("Foo");
+ try {
+ throw new Exception("Bar", 0, $e);
+ } finally {
+ throw new Exception("Dummy", 0, $e);
+ }
+} catch (Exception $e) {
+ var_dump((string)$e);
}
?>
--EXPECTF--
-Fatal error: Uncaught Exception: Bar in %sbug70944.php:%d
+string(%d) "exception 'Exception' with message 'Foo' in %sbug70944.php:%d
+Stack trace:
+#0 {main}"
+string(%d) "exception 'Exception' with message 'Foo' in %sbug70944.php:%d
Stack trace:
#0 {main}
- thrown in %sbug70944.php on line %d
+
+Next exception 'Exception' with message 'Dummy' in %sbug70944.php:%d
+Stack trace:
+#0 {main}"