Re: Inheritance Question

From: Date: Wed, 09 Oct 2002 03:21:17 +0000
Subject: Re: Inheritance Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-119380@lists.php.net to get a copy of this message
Hi! I don't know about the memory, but I think the "recommended" way would be your first choice because you might want to redefine method jk() in class bar... I would suspect that would also be recommended performance-wise as well - since that's the typical way to call methods, I think it's better optimised. Just my 2c, of course. Bogdan Jarrad Kabral wrote:
Hi all, Was just wondering which is the better way to call an inherited method from a child class? Example: class foo {
    function jk() {
        echo "In here!";
    }
} class bar extends foo {
    function do_something() {
        //Either this one...
        $this->jk();
        //Or this one...??
        foo::jk();
    }
} Which is the best way? Is one a way a less memory intensive way than the other? Thanks in advance Jarrad Kabral


« previous php.general (#119380) next »