dunno if this'll help, but try changing these two lines $this->$obj = new test1; $test = new test2;
to these $this->$obj = &new test1; $test = &new test2; see if that helps - other than that - anyone else? -----Original Message----- From: Aric Caley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Could somebody PLEASE explain this one to me Why, oh WHY doesnt this work. I get the error: Fatal error: Call to a member function on a non-object in c:\home\digerati\www\classtest.php3 on line 23 ???? If I try to make any assignments, anywhere, it dies. What the HELL is going on? Obviously I must be missing something really obvious, I Just dont know what it is. <?php class test1 { function echotest() { echo "hi!"; } } class test2 { var $obj; var $test; function test2() { $this->$obj = new test1; $this->$test = "duh?"; //** if you take out this line, it works. } function thisisatest() { $this->$obj->echotest(); } } $test = new test2; $test->thisisatest(); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]