php-src/Zend/tests/bug70944.phpt

30 lines
496 B
Plaintext
Raw Normal View History

--TEST--
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
try {
2015-11-21 16:27:56 +08:00
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw $e;
}
} catch (Exception $e) {
var_dump($e->getMessage());
}
try {
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw new Exception("Dummy", 0, $e);
}
} catch (Exception $e) {
var_dump($e->getMessage());
}
?>
2015-11-21 16:27:56 +08:00
--EXPECT--
string(3) "Foo"
string(5) "Dummy"