2010-08-16 17:20:46 +08:00
|
|
|
--TEST--
|
|
|
|
Bug #52361 (Throwing an exception in a destructor causes invalid catching)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
class aaa {
|
|
|
|
public function __destruct() {
|
|
|
|
try {
|
|
|
|
throw new Exception(__CLASS__);
|
|
|
|
} catch(Exception $ex) {
|
|
|
|
echo "1. $ex\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function bbb() {
|
|
|
|
$a = new aaa();
|
|
|
|
throw new Exception(__FUNCTION__);
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
bbb();
|
|
|
|
echo "must be skipped !!!";
|
|
|
|
} catch(Exception $ex) {
|
|
|
|
echo "2. $ex\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2015-05-18 00:35:18 +08:00
|
|
|
1. Exception: aaa in %sbug52361.php:5
|
2010-08-16 17:20:46 +08:00
|
|
|
Stack trace:
|
2014-07-07 20:57:05 +08:00
|
|
|
#0 %sbug52361.php(13): aaa->__destruct()
|
2010-08-16 17:20:46 +08:00
|
|
|
#1 %sbug52361.php(16): bbb()
|
|
|
|
#2 {main}
|
2015-05-18 00:35:18 +08:00
|
|
|
2. Exception: bbb in %sbug52361.php:13
|
2010-08-16 17:20:46 +08:00
|
|
|
Stack trace:
|
|
|
|
#0 %sbug52361.php(16): bbb()
|
|
|
|
#1 {main}
|