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 207bf2a commit b41a117Copy full SHA for b41a117
Zend/tests/type_declarations/static_type_return.phpt
@@ -26,6 +26,10 @@ class B extends A {
26
27
class C extends B {}
28
29
+function test(): static {
30
+ return new stdClass;
31
+}
32
+
33
$a = new A;
34
$b = new B;
35
@@ -52,6 +56,13 @@ try {
52
56
echo $e->getMessage(), "\n";
53
57
}
54
58
59
+echo "\n";
60
+try {
61
+ var_dump(test());
62
+} catch (TypeError $e) {
63
+ echo $e->getMessage(), "\n";
64
65
55
66
?>
67
--EXPECT--
68
object(A)#3 (0) {
@@ -71,3 +82,5 @@ object(C)#3 (0) {
71
82
72
83
73
84
Return value of A::test4() must be of type static|array, instance of A returned
85
86
+Return value of test() must be an instance of static, instance of stdClass returned
0 commit comments