Code editor shows errors when there are none (6.0.1)

PHPStorm 6.0.1 is continually showing errors in my code when there clearly aren't any. It's like it has 'forgotten' how to interpret PHP.

Here's an example:


1. Function params (line 12) are grey underlined as 'unused' in the local space. This is clearly wrong as you can see in the SQL it's being used.
2. "curDistance" is underlined as red and says it's "undefined." Two lines (line 21) up you can clearly see it is in fact defined.

If I copy the code and paste it just below it (and change the method name so we don't have conflicts) there are magically no errors (until I start making edits on some line, then it will 'forget' how to interpret again.)

Example of this:

Any ideas what's going on?


Hi there,

To start with -- I suggest "File | Invalidate caches..." -- very often it's enough to fix such out-of-nowhere behaviour.


Seems that did the trick. Thank you!


Thank you as well! This was driving me nuts!


I was close to smashing my desk. Thank you for saving it.


Please sign in to leave a comment.