Lets say I made class A that has a function that adds two numbers together, I make an instance of calls A and name it $A.
Now, I make another class, class B that needs to use the function from class A. I don't want class B to inherit A's function, I want to use the function from a class A instance, could I do it like this:
$A = new A();
class B
{
function somefunc()
{
global $A;
$A->someotherfunc();
}
}
Dunno if that made sense, but... 😃
TIA 🙂