firstly I would say that there are few instances where you would need global variables, I haven't used any in a long time and at the moment I can't think of any situation where i would. Although saying that it may be the easier solution if you are new to OOP.
if I were to do this I would use a class with statics vars as you said
1 person found this helpful
yes, you can use a class that has static variables. if you want your class to validate the variables, you can use private static variables and public getters and settings. otherwise, you can use public static variables.
Thank you both!
I noticed that now im understanding OOP a bit better I finf great pleasure in the way things are accessible.
In one case though I have somve very large vectors.
I thought it would benefit performance if I could just access these directly from any class.
I dont use glabal vars anymore, more like a global class in the form of a Model that I inject into views (via presenters) using Swiz