]> granicus.if.org Git - php/commitdiff
Added test
authorDmitry Stogov <dmitry@zend.com>
Thu, 11 Apr 2019 18:37:10 +0000 (21:37 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 11 Apr 2019 18:37:10 +0000 (21:37 +0300)
Zend/tests/bug29368_2.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug29368_2.phpt b/Zend/tests/bug29368_2.phpt
new file mode 100644 (file)
index 0000000..acecefc
--- /dev/null
@@ -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