summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70944.phpt
blob: 6a617f5e465c60a7ca0e2fc82037d574d4ad43fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
try {
    $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--
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}"
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}

Next Exception: Dummy in %sbug70944.php:%d
Stack trace:
#0 {main}"