the run function in b overrides the run function in a, thats why it
echo's "B"

On Fri, 2005-01-21 at 18:37, Dmitry wrote:
> Greetings.
> 
> If i run this code (php5):
> ------------------------------------------
> class a {
>  function say() { echo "A"; }
>  function run() { $this->say(); }
> }
> class b extends a {
>  function say() { echo "B"; }
>  function run() { parent::run(); }
> }
> 
> $obj = new b;
> $obj->run();
> ---------------------------------------
> 
> I will get "B", but how i may get "A"? 
-- 
Regards,
Matthew Fonda

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to