We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5ae423 commit 584d872Copy full SHA for 584d872
1 file changed
tests/PHPStan/Rules/Comparison/data/bug-13566.php
@@ -165,5 +165,27 @@ function test(): void
165
{
166
// send 404 header
167
notFound(false);
168
+}
169
+
170
171
+class ReturnViaUnion
172
+{
173
+ /**
174
+ * @return ($exit is int ? void : never)
175
+ */
176
+ public static function notFound(int|string $exit = 'hello world'): void
177
+ {
178
+ header('HTTP/1.1 404 Not Found', true, 404);
179
180
+ if (!is_int($exit)) {
181
+ echo '404 Not Found';
182
+ exit;
183
+ }
184
185
186
+ public function test(): void
187
188
+ // send 404 header
189
+ self::notFound(0);
190
191
}
0 commit comments