DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
82 stars 10 forks source link

No errors are shown for undefined global variables #718

Open DamianoP opened 2 weeks ago

DamianoP commented 2 weeks ago

As you can see from the screen, the variable $test does not exist, and no error appears. In practice, the global variables appear to be not validated. Instead, the local variable $x is checked and reported as problematic.

Screenshot 2024-11-04 alle 15 47 12

Is it possible to display an error indicating that $test does not exist?

jakubmisek commented 2 weeks ago

Thank you for the question, and the suggestion.

We intentionally ignore undefined global variables because they are usually defined dynamically - so we can't be sure they really are undefined.

I think we can add a setting to adjust that.