We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 712c416 commit 4360aa7Copy full SHA for 4360aa7
Zend/tests/type_declarations/callable/callable_variance_closure.phpt
@@ -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