Jump to content

return a class pbject from within another class


chipk1

Recommended Posts

This doesn't seem to work? What am I doing wrong?

------------------------------------------------------------------
class A
{
var $data;

function A() {
$this->data = "information to be displayed";
}
}

class B
{
var $a;

function B() {
$a = new A();
}
}


$c = new B();

echo $c->a->data;
------------------------------------------------

It does not echo "information to be displayed"????????????

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.