We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce34267 commit d60cc3dCopy full SHA for d60cc3d
1 file changed
tests/PHPStan/Analyser/nsrt/bug-7858.php
@@ -19,3 +19,27 @@ function bar(int $year): void
19
}
20
assertType('int<2022, max>', $year);
21
22
+
23
+function baz($year): void
24
+{
25
+ if (!ctype_digit($year) || (int)$year < 2022) {
26
+ throw new \RuntimeException();
27
+ }
28
+ assertType('int<2022, max>|numeric-string', $year);
29
+}
30
31
+function bam(int|string $year): void
32
33
34
35
36
37
38
39
+function ban(string $year): void
40
41
42
43
44
+ assertType('numeric-string', $year);
45
0 commit comments