1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/reflection/tests/bug77882.phpt
2020-02-03 22:52:20 +01:00

39 lines
623 B
PHP

--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