Skip to content

Commit d015a48

Browse files
committed
Update bug-13857.php
1 parent b7e4706 commit d015a48

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
function test(array $array, int $id): void {
1313
$array[$id]['state'] = 'foo';
14+
// only one element was set to 'foo', not all of them.
1415
assertType("non-empty-array<int, array{state: 'foo'}>", $array);
1516
}
1617

@@ -19,6 +20,7 @@ function test(array $array, int $id): void {
1920
*/
2021
function testMaybe(array $array, int $id): void {
2122
$array[$id]['state'] = 'foo';
23+
// only one element was set to 'foo', not all of them.
2224
assertType("non-empty-array<int, array{state: 'foo'}>", $array);
2325
}
2426

@@ -27,6 +29,7 @@ function testMaybe(array $array, int $id): void {
2729
*/
2830
function testUnionValue(array $array, int $id): void {
2931
$array[$id]['state'] = 'foo';
32+
// only one element was set to 'foo', not all of them.
3033
assertType("non-empty-array<int, array{state: 'foo'}>", $array);
3134
}
3235

@@ -35,6 +38,7 @@ function testUnionValue(array $array, int $id): void {
3538
*/
3639
function testUnionArray(array $array, int $id): void {
3740
$array[$id]['state'] = 'foo';
41+
// only one element was set to 'foo', not all of them.
3842
assertType("non-empty-array<int, array{foo?: int, state: 'foo'}>", $array);
3943
}
4044

0 commit comments

Comments
 (0)