Warning on variable reuse

Something Netbeans can do is warn if a variable is reused and underlines with a yellow line. Can PhpStorm do the same thing?

I was just playing with some legacy code where reuse is rife, and without the underline it's proving difficult to track down the bugs in the reuse.


I see there is the option for JavaScript, but it's not there for PHP which seems odd.



1 comment
Comment actions Permalink

Hi there,

As far as I know there is no such inspection for PHP .. and nobody ever asked for it before (considering that such reuse happens quite often in actual code .. no wonders why (for example: $i as cycle counter; $s for some string manipulations etc)).

You are welcome to submit Feature Request ticket at Issue Tracker -- https://youtrack.jetbrains.com/issues/WI


P.S. There is custom plugin called "PHP Inspections (EA Extended)" that provides quite a lot of additional inspections. You may also submit similar Feature Request ticket there. Considering the author and already existing inspections it provides .. it may get implemented there faster than in actual IDE. https://bitbucket.org/kalessil/phpinspectionsea/issues


Please sign in to leave a comment.