mirror of
https://github.com/php/php-src.git
synced 2024-11-27 20:03:40 +08:00
22 lines
381 B
PHP
22 lines
381 B
PHP
--TEST--
|
|
Bug #29368.2 (The destructor is called when an exception is thrown from the constructor).
|
|
--FILE--
|
|
<?php
|
|
class Bomb {
|
|
function foo() {
|
|
}
|
|
function __destruct() {
|
|
throw new Exception("bomb!");
|
|
}
|
|
}
|
|
try {
|
|
$x = new ReflectionMethod(new Bomb(), "foo");
|
|
} catch (Throwable $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
echo "ok\n";
|
|
?>
|
|
--EXPECT--
|
|
bomb!
|
|
ok
|