Skip to content

Commit ac74551

Browse files
committed
Drop unnecessary try/catch
1 parent 1bf0dd7 commit ac74551

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

Zend/tests/type_declarations/intersection_types/added_interface_intersection_type.phpt

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,15 @@ function bar(X&Y $o): void {
2121
var_dump($o);
2222
}
2323

24-
try {
25-
$o = foo();
26-
var_dump($o);
27-
} catch (\TypeError $e) {
28-
echo $e->getMessage(), "\n";
29-
}
24+
$o = foo();
25+
var_dump($o);
3026

3127
$c = new Collection();
3228
$a = new A();
3329

34-
try {
35-
$c->intersect = $a;
36-
echo 'OK', \PHP_EOL;
37-
} catch (\TypeError $e) {
38-
echo $e->getMessage(), "\n";
39-
}
40-
41-
try {
42-
bar($a);
43-
} catch (\TypeError $e) {
44-
echo $e->getMessage(), "\n";
45-
}
46-
30+
$c->intersect = $a;
31+
echo 'OK', \PHP_EOL;
32+
bar($a);
4733
?>
4834
--EXPECT--
4935
object(A)#1 (0) {

0 commit comments

Comments
 (0)