mirror of
https://github.com/php/php-src.git
synced 2024-12-13 03:44:17 +08:00
3ae995f03c
This implements a reduced variant of #1226 with just the following change: -Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d +Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d The '' wrapper around messages is very weird if the exception message itself contains ''. Futhermore having the message wrapped in '' doesn't work for the "and defined" suffix of TypeExceptions.
34 lines
638 B
PHP
34 lines
638 B
PHP
--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
|