Skip to content

Commit 0eb267b

Browse files
committed
another test
1 parent f55eb37 commit 0eb267b

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ public static function notFound(int $exit = 1): void
3535
}
3636
}
3737

38+
public function test(): void
39+
{
40+
// send 404 header
41+
self::notFound(0);
42+
}
43+
}
44+
45+
class ReturnViaIntNonNative
46+
{
47+
/** @return ($exit is 1 ? never : void) */
48+
public static function notFound(int $exit = 1)
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+
}
3857

3958
public function test(): void
4059
{
@@ -57,7 +76,6 @@ public static function notFound(bool $exit = true)
5776
return 1;
5877
}
5978

60-
6179
public function test(): void
6280
{
6381
// send 404 header
@@ -80,7 +98,6 @@ public static function notFound(bool $exit = true)
8098
return 1;
8199
}
82100

83-
84101
public function test(): void
85102
{
86103
// send 404 header

0 commit comments

Comments
 (0)