note 24313 added to keyword.extends
| From: | jasonv6 at hotmail dot com | Date: | Tue, 13 Aug 2002 01:04:16 +0000 |
| Subject: | note 24313 added to keyword.extends | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34904@lists.php.net to get a copy of this message | ||
Hi, i have a problem with a simple code. I extend a class A with a class B. In the class B, i have
access to the class A functions in the class B but not the variables ! Here is a simple code that
works the same as my code :
class A {
var $Avar;
function A () {
$Avar = "A var";
}
}
class B extends A {
function B () {
echo "$this->$Avar";
}
}
$aclass = new A ();
$bclass = new B ();
it echoes nothing ! ! ! !
--
http://www.php.net/manual/en/keyword.extends.php
http://master.php.net/manage/user-notes.php?action=edit+24313
http://master.php.net/manage/user-notes.php?action=delete+24313
http://master.php.net/manage/user-notes.php?action=reject+24313