0
votes
1answer
97 views

How to avoid repeatedly use the new statement to instantiate a class? [closed]

I have a Class with a lot of variables. To get a variable, I have to write this line in each function: $x = new MY_Class(); I guess there has to be another way? I tried: function my_data(){ ...