In this code foreach ($new_users as $newuser) { $newuser['pass'] = f(); } the highlighter seems to miss the fact that the two occurences of $newuser refer to the same varible. The second occurence is rendered in bold, and when the cursor hovers, only the second is highlighted, and the tooltip refers to that line as the source of the variable declaration. The expected behavoiur would be to highlight both, and refer to the first occurence as the point of definition.
Git commit 75493103a0b53ddc364b229020ffde216ea7d7cb by Milian Wolff. Committed on 29/03/2012 at 19:35. Pushed by mwolff into branch '1.3'. take range into account when looking for redeclarations probably we should refactor the handling of foreach variables, since right now we have to visit the TypeBuilder::visitStatement before declaring the variables. this has side-effects since it also means we visit the foreach-body statements before declaring the variables... M +2 -1 duchain/builders/declarationbuilder.cpp M +43 -0 duchain/tests/duchain.cpp M +1 -0 duchain/tests/duchain.h http://commits.kde.org/kdev-php/75493103a0b53ddc364b229020ffde216ea7d7cb