I would like to create a class with an instance of another class used as a property. Something like this:
class person
{
var $name;
var $address;
}
class business
{
var $owner = new person();
var $type;
}
This, of course, does not work, and I have tried a few variations. Everything I have found in Google searches only references nested class definitions (class a { class b{ } }
).
Is it possible to put a class instance in another class? If not, is there a reasonable work-around?