Skip to content
Permalink
Browse files

Detect function in array access op

  • Loading branch information...
muglug committed Aug 13, 2019
1 parent da230bc commit 0468d11158eafa115bcae37a09f9eaa0c67e17a5
@@ -721,10 +721,6 @@ public static function analyzeAssignmentOperation(
return false;
}
if (!$was_in_assignment) {
$context->inside_assignment = false;
}
$array_var_id = ExpressionAnalyzer::getArrayVarId(
$stmt->var,
$statements_analyzer->getFQCLN(),
@@ -831,6 +827,10 @@ public static function analyzeAssignmentOperation(
}
}
if (!$was_in_assignment) {
$context->inside_assignment = false;
}
return null;
}
@@ -1046,6 +1046,16 @@ function getLastNum(array $a): int {
return $last;
}'
],
'usedStrtolowerInArray' => [
'<?php
/**
* @param array<string, int> $row
*/
function foo(array $row, string $s) : array {
$row["a" . strtolower($s)] += 1;
return $row;
}',
],
];
}

0 comments on commit 0468d11

Please sign in to comment.
You can’t perform that action at this time.