Skip to content

Commit 1189a06

Browse files
phpstan-botclaude
andcommitted
Add test cases for int-range and non-empty-string intersection types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 06925a8 commit 1189a06

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/PHPStan/Analyser/nsrt/bug-11234.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ function testIntersectNonEmptyStringValue(mixed $x): void
6565
{
6666
assertType('array{non-empty-string, Bug11234\Payload}', $x);
6767
}
68+
69+
/** @param array{0|1|2|3, non-empty-string|int|null}&array{int, string} $x */
70+
function testIntersectNonEmptyStringInUnion(mixed $x): void
71+
{
72+
assertType('array{0|1|2|3, non-empty-string}', $x);
73+
}
74+
75+
/** @param array{0|1|2|3, string|null}&array{int, non-empty-string} $x */
76+
function testIntersectWithNonEmptyStringOtherSide(mixed $x): void
77+
{
78+
assertType('array{0|1|2|3, non-empty-string}', $x);
79+
}

0 commit comments

Comments
 (0)