oop errors

From: Date: Fri, 09 Jun 2000 11:36:51 +0000
Subject: oop errors
Groups: php.general 
Request: Send a blank email to php-general+get-1382@lists.php.net to get a copy of this message
hi, Could somebody please tell me what I'm doing wrong here. I get the following error, <br> <b>Fatal error</b>: Call to a member function on a non-object in <b>-</b> on line <b>17</b><br> when I run the following script, <? class Foo { var $x; function bar() { $self->x = 1; echo 'self->x is: ' . $self->x; $self->x = 2; } function quux() { echo 'self->x is: ' . $self->x; } function disp() { $self->bar(); $self->quux(); } } $f = new Foo; $f->disp(); ?> - cnb.

« previous php.general (#1382) next »