note 33703 added to language.oop

From: Date: Fri, 04 Jul 2003 14:42:15 +0000
Subject: note 33703 added to language.oop
Groups: php.notes 
Request: Send a blank email to php-notes+get-51513@lists.php.net to get a copy of this message
The $this reference means the current object, which calls the function or property. If we call from the derived class with the :: operator a function defined in the base class , $this will represent the object of the derived class: class a{ var $a=1; function display(){ echo $this->a; } } class b extends a{ var $a=9; function disp(){ a::display(); } } $x=new b; $x->disp(); It will display 9. ---- Manual Page -- http://www.php.net/manual/en/language.oop.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33703 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33703&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33703&report=yes

« previous php.notes (#51513) next »