What is the best way to get a global variable inside a class?
I know that I can just use "global $ tmpVar;" inside the class function, but is there a way for a global variable, so it is available for all class functions without the need for the ugly global $ tmpVar; inside each function?
Ideally, immediately after declaring the tmpClass () {"class, it would be great, but not sure if this is possible.
source
share