Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validUndefinedVariableNamesInFileScope #243

Open
andrewnicols opened this issue Feb 28, 2022 · 1 comment
Open

Add validUndefinedVariableNamesInFileScope #243

andrewnicols opened this issue Feb 28, 2022 · 1 comment

Comments

@andrewnicols
Copy link

Where a variable is available within the File scope, it will not be available within a function scope without the use of global $varname;.

At the moment it's possible to either set:

  • validUndefinedVariableNames, but this will incorrectly apply within function scope where the variable is not available to be used; or
  • allowUndefinedVariablesInFileScope, but this is an on/off value and may not be accurate.

It should be possible to define which variables are allowed to be used within the file scope.

@sirbrillig
Copy link
Owner

This is a good idea and I think should be fairly easy to implement. I'll see if I can make the time to do so (although if you have time, feel free to give it a try!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants