Is there a way to get around having to reference Global variables inside a function in PHP?
I just hate having to use the ‘global’ keyword for every variable, and I’ve been told that using constants (as an alternative) in PHP affects performance badly.
if you have to use many global variables inside of your function, something has been designed wrong.
Using even a few global variables considered bad practice, making code non-obvious.
And constants are not a solution despite of falseness of that “badly performance” rumor
If you need to use many variables inside of a function, consider array use
simple, reliable and readable
with more detailed explanation of what this function do and what all these variables for, you can get more precise answer.