Skip to content

Commit db93c26

Browse files
committed
Added test
1 parent 2784477 commit db93c26

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Zend/tests/bug29368_2.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Bug #29368.2 (The destructor is called when an exception is thrown from the constructor).
3+
--FILE--
4+
<?php
5+
class Bomb {
6+
function foo() {
7+
}
8+
function __destruct() {
9+
throw new Exception("bomb!");
10+
}
11+
}
12+
try {
13+
$x = new ReflectionMethod(new Bomb(), "foo");
14+
} catch (Throwable $e) {
15+
echo $e->getMessage() . "\n";
16+
}
17+
echo "ok\n";
18+
?>
19+
--EXPECT--
20+
bomb!
21+
ok

0 commit comments

Comments
 (0)