RE: [PHP] inheritance php4
| From: | bruce | Date: | Tue, 12 Dec 2006 19:09:07 +0000 |
| Subject: | RE: [PHP] inheritance php4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245769@lists.php.net to get a copy of this message | ||
hi...
haven't used php classes.. so this might not pertain.. but do php classes
have the concept of public/private functions? are the parent functions that
you're trying to access public/private?
-----Original Message-----
From: blackwater dev [mailto:blackwaterdev@gmail.com]
Sent: Tuesday, December 12, 2006 11:00 AM
To: php-general@lists.php.net
Subject: [PHP] inheritance php4
Ok,
I have a class which inherits from a parent class. My first thought is that
the child class inherits all of the functions of the parent but that doesn't
seem to be the case, do I really have to put parent::somefunction() to call
each one? Why can't I just use $this->parentfunction(); within the child
class?
Thanks!
class Parent{
function getAddress(){}
}
class Child extends Parent{
function getInfo(){
$this->getAddress(); //throws error
}
}