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
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php