PhpStorm structural searching to find a self-assignment in a foreach loop
问题 I have noticed a pattern among some of my team's developers where we will do a self-assignment of an array in a foreach loop, and I am looking for the proper search parameters to pass into PhpStorm's structural search to match the first workflow, but not the second in the following example: public function example() { $array = []; foreach ($array as $a) { $array[$a] = 1; //Match this one } $someOtherVariable = []; foreach($array as $ab) { $someOtherVariable[] = 2; //Don't match this one } }