1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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
|