Hi, I want to load one variable in one class in two or more different functions. Please see my example: class functions { public $data; function a() { global $data; b(); } function b() { global $data; } } PHP: After passing function a data not executes on function b as global variable. I don`t want to rename same $data for second time to use it on send function. So I need proper solution for this, how can I make $data to be executed in function b() also.
the best approach here is by using abtract class, place the variable in an abstract class then simple extend it to all child classes