Field not found warning

I have this simple class:

 
class TestClass {
    public $myvar;

    function __construct() {
        print_r($this->myvar);
    }
}


I am puzzles because PHPStorm highlights "myvar" as a warning with this comment:

"Field 'myvar' not found in class test"

I have tried File > Invalidate Cache to no avail.  

This is a Wordpress plugin project.  However the exact same file works fine (no warning) when included in an empty PHP project, so I think something must be wrong in my project settings.  Question is, what might it be??

3 comments
Comment actions Permalink

Please try File | Invalidate Caches and restart. What's your exact version of the IDE (Help | About)?

0
Comment actions Permalink

Yes I have tried Invalidate and restart.  I have PHP Storm 8.0.3.  Build PS-139.1348.

0
Comment actions Permalink

I believe I figured out the problem, it looks like this does not work when accessing the project through a Windows share.  I set up a link to the actual project (using mklink), rather than using a UNC path, but it still does not like parsing those files when they are on the network it seems.  Bummer but I can work around it.

0

Please sign in to leave a comment.