summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-04-11 21:37:10 +0300
committerDmitry Stogov <dmitry@zend.com>2019-04-11 21:37:10 +0300
commitdb93c26e6d77e615957d47d6284ec49763d42113 (patch)
treee5b0d44f789ca2074a8a9d398acd5765bcb46497 /Zend
parent27844773d85e38625318da60b4197afe79d3d59a (diff)
downloadphp-git-db93c26e6d77e615957d47d6284ec49763d42113.tar.gz
Added test
Diffstat (limited to 'Zend')
-rw-r--r--Zend/tests/bug29368_2.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/bug29368_2.phpt b/Zend/tests/bug29368_2.phpt
new file mode 100644
index 0000000000..acecefcb9b
--- /dev/null
+++ b/Zend/tests/bug29368_2.phpt
@@ -0,0 +1,21 @@
+--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