Skip to content

Commit 4360aa7

Browse files
committed
Add new failing test
1 parent 712c416 commit 4360aa7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Closure should be covariant with callable
3+
--FILE--
4+
<?php
5+
6+
class A {
7+
public function foo(Closure $c): callable {}
8+
}
9+
class B extends A {
10+
public function foo(callable $c): Closure {}
11+
}
12+
?>
13+
--EXPECTF--
14+
Fatal error: Declaration of B::foo(callable $c): Closure must be compatible with A::foo(Closure $c): callable in %s on line %d

0 commit comments

Comments
 (0)