Uzytkownik "Curt Zirzow" <[EMAIL PROTECTED]> napisal w
wiadomosci
> * 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
Thank's, all works fine.
There is also no bug - in my previous version I had self::generuj_strone();
not generuj_strone(); as I wrote.
Thanks a lot
Krzysztof Gorzelak
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php