summaryrefslogtreecommitdiff
path: root/Zend/tests/bug53511.phpt
blob: 0075655428b8de510699a0ccfd1607510c8ae2c5 (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
--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: ops 2 in %sbug53511.php:11
Stack trace:
#0 %sbug53511.php(17): test()
#1 {main}

Next Exception: 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