An example follows.....
Code: Select all
class A
{
function Times($arg)
{
echo $arg * 2;
}
}
$a = new A();
class B
{
function Double($arg)
{
global $a;
$a->Times($arg); // Trying to use the Times function in class A
}
}
$b = new B();
$b->Double(5);