CODE
class foo
{
function foo()
{
$this->bar = 'barbarbar';
}
}
{
function foo()
{
$this->bar = 'barbarbar';
}
}
CODE
class bar
{
function bar()
{
$this->foo = 'foofoofoo';
}
}
{
function bar()
{
$this->foo = 'foofoofoo';
}
}
"foo" is my main class, and I want to initialize it first:
CODE
$foo = new foo;
but I also want "bar"'s methods and properties to be available under $foo, how can I do this?
E.G.
CODE
$foo->bar();
echo $foo->foo;
echo $foo->foo;
as well as:
CODE
$foo->foo();
echo $foo->bar;
echo $foo->bar;
I should also make it clear that I don't want to have to do $foo->bar = new bar; and have to access "bar"'s methods and properties that way.
