We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc0bf26 commit 109b572Copy full SHA for 109b572
tests/PHPStan/Analyser/nsrt/bug-13301-php8.php
@@ -12,4 +12,16 @@ function doFoo($mixed) {
12
assertType('array', $mixed); // could be array~hasOffset('a') after arrays got subtractable
13
echo "NO-a";
14
}
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
27
0 commit comments