Skip to content

Commit 9dd293c

Browse files
committed
test string scalar
1 parent e82df4d commit 9dd293c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/PHPStan/Rules/Comparison/data/bug-13566.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ public function test(): void
4242
}
4343
}
4444

45+
class ReturnViaString
46+
{
47+
/** @return ($exit is '1' ? never : void) */
48+
public static function notFound(string $exit = '1'): void
49+
{
50+
header('HTTP/1.1 404 Not Found', true, 404);
51+
52+
if ($exit == '1') {
53+
echo '404 Not Found';
54+
exit;
55+
}
56+
}
57+
58+
public function test(): void
59+
{
60+
// send 404 header
61+
self::notFound('0');
62+
}
63+
}
64+
4565
class ReturnViaIntNonNative
4666
{
4767
/** @return ($exit is 1 ? never : void) */

0 commit comments

Comments
 (0)