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 425b239 commit 1cfba8bCopy full SHA for 1cfba8b
fixtures/completion/foreach.php
@@ -36,5 +36,5 @@ public function test() { }
36
$
37
}
38
39
-foreach ($unknownArray as $unknown) {
+foreach ($unknownArray as $member->access => $unknown) {
40
$unkno
src/DefinitionResolver.php
@@ -571,7 +571,9 @@ public function resolveVariableToNode($var)
571
572
// If we get to a ForeachStatement, check the keys and values
573
if ($n instanceof Node\Statement\ForeachStatement) {
574
- if ($n->foreachKey && $n->foreachKey->expression->getName() === $name) {
+ if ($n->foreachKey instanceof Node\Expression\Variable
575
+ && $n->foreachKey->expression->getName() === $name
576
+ ) {
577
return $n->foreachKey;
578
579
if ($n->foreachValue
0 commit comments