inheritance php4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

}

}

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux