Forum Moderators: coopster
Simple enough question I can't seem to find the answer to.
I have two classes, A and B.
B is created as an object within A, but also needs to use a variable within A. How do you reference it?
Example,
class A {
var somevar = "test";
A { $obj = new B (); }
}
class B {
B { print ( * $somevar from the A class * ); }
}
The class B is trying to use the variable $somevar declared in class A. I just don't know how to use the variable.
Thank you.
N.B. I am running PHP 4 not 5