Skip to content

Commit 84b84ec

Browse files
committed
Check redundant type check works
1 parent c054ad8 commit 84b84ec

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Duplicate parent type
3+
--FILE--
4+
<?php
5+
6+
class A {}
7+
class B extends A {
8+
public function test(): parent&A&parent {
9+
}
10+
}
11+
12+
?>
13+
--EXPECTF--
14+
Fatal error: Duplicate type parent is redundant in %s on line %d
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Duplicate self type
3+
--FILE--
4+
<?php
5+
6+
class A {
7+
public function test(): self&A&self {
8+
}
9+
}
10+
11+
?>
12+
--EXPECTF--
13+
Fatal error: Duplicate type self is redundant in %s on line %d

0 commit comments

Comments
 (0)