We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49911f9 commit 9b7fe1fCopy full SHA for 9b7fe1f
tests/PHPStan/Analyser/nsrt/bug-8985.php
@@ -100,3 +100,12 @@ function testClassConstFetch(): void {
100
101
assertType("'const_value'", (new Repository())::MY_CONST);
102
}
103
+
104
+function testClassConstFetchOnUnknownClass(string $class, string $anotherClass): void {
105
+ assert((new $class())::MY_CONST === 'const_value');
106
107
+ assertType("'const_value'", (new $class())::MY_CONST);
108
109
+ $class = $anotherClass;
110
+ assertType("*ERROR*", (new $class())::MY_CONST);
111
+}
0 commit comments