xref: /PHP-8.1/Zend/tests/exception_001.phpt (revision b10416a6)
1--TEST--
2Testing nested exceptions
3--FILE--
4<?php
5
6try {
7    try {
8        try {
9            try {
10                throw new Exception();
11            } catch (Exception $e) {
12                var_dump($e->getMessage());
13                throw $e;
14            }
15        } catch (Exception $e) {
16            var_dump($e->getMessage());
17            throw $e;
18        }
19    } catch (Exception $e) {
20        var_dump($e->getMessage());
21        throw $e;
22    }
23} catch (Exception $e) {
24    var_dump($e->getMessage());
25    throw $e;
26}
27
28?>
29--EXPECTF--
30string(0) ""
31string(0) ""
32string(0) ""
33string(0) ""
34
35Fatal error: Uncaught Exception in %s:%d
36Stack trace:
37#0 {main}
38  thrown in %s on line %d
39