php-src/Zend/tests/bug29368_2.phpt
Dmitry Stogov db93c26e6d Added test
2019-04-11 21:37:10 +03:00

22 lines
357 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