NYCPHP Meetup

NYPHP.org

[nycphp-talk] static methods in derived classes

Joseph Crawford codebowl at gmail.com
Thu Sep 23 10:49:38 EDT 2004


no that might work for a work around however it is within the way Self:: works.

in the 

class Meal {
    public static function eat() {
        $food = self::prepare();
        self::chew($food);
    }
}

self:: is actualy Meal

so when it tries to fine Meal::prepare, it fatals saying cannot find
the method, in reality the method is not there, however putting the
prepare in the Meal and overloading wouldnt work either now that i
think of it, because Meal::prepare would be called and Lunch::prepare
would never be called so even overloading wouldnt work.

David, 

i know you are poking around trying to figure out why self:: works in
this manor, if you find any work arounds or good reads on this please
pass them to me.


-- 
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
802-558-5247

For a GMail account
contact me OFF-LIST



More information about the talk mailing list