* Thus wrote Krzysztof Gorzelak:
> // start of code
> abstract class Strona {
> 
>     abstract public function generuj_strone();
> 
>     function foo() {
>         generuj_strone();
>     }
> }
> 
> class Katalog extends Strona {
>      public function generuj_strone() {
>         echo "OK";
>      }
> 
> }
> 
> $bar = new Katalog();
> $bar->foo();
> // end of code
> And I get such error :
> Fatal error: Cannot call abstract method Strona::generuj_strone() in ....
> 
> And I expect word: OK
> Is it a bug or a normal behaviour ?

It may be a bug, but not in the sense as your probably think. The
error message should be complaining about an undefined function
instead of trying to access self::generuj_strone()

In foo() use:
   $this->generuj_strone();

That will make things work properly

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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

Reply via email to