summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug77882.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/bug77882.phpt')
-rw-r--r--ext/reflection/tests/bug77882.phpt38
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug77882.phpt b/ext/reflection/tests/bug77882.phpt
new file mode 100644
index 0000000000..ff1d212861
--- /dev/null
+++ b/ext/reflection/tests/bug77882.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #77882: Different behavior: always calls destructor
+--FILE--
+<?php
+
+class Test {
+ public function __construct() {
+ throw new Exception();
+ }
+
+ public function __destruct() {
+ echo "__destruct\n";
+ }
+}
+
+try {
+ new Test();
+} catch (Exception $e) {
+ echo "Exception\n";
+}
+try {
+ $ref = new ReflectionClass('Test');
+ $obj = $ref->newInstance();
+} catch (Exception $e) {
+ echo "Exception\n";
+}
+try {
+ $ref = new ReflectionClass('Test');
+ $obj = $ref->newInstanceArgs([]);
+} catch (Exception $e) {
+ echo "Exception\n";
+}
+
+?>
+--EXPECT--
+Exception
+Exception
+Exception