Skip to content

Commit 109b572

Browse files
committed
Update bug-13301-php8.php
1 parent bc0bf26 commit 109b572

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-13301-php8.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ function doFoo($mixed) {
1212
assertType('array', $mixed); // could be array~hasOffset('a') after arrays got subtractable
1313
echo "NO-a";
1414
}
15+
assertType('array', $mixed);
16+
}
17+
18+
function doArray(array $arr) {
19+
if (array_key_exists('a', $arr)) {
20+
assertType("non-empty-array&hasOffset('a')", $arr);
21+
echo "has-a";
22+
} else {
23+
assertType('array', $arr);
24+
echo "NO-a";
25+
}
26+
assertType('array', $arr);
1527
}

0 commit comments

Comments
 (0)