NYCPHP Meetup

NYPHP.org

[nycphp-talk] Static variables, self:: and abstract classes

Daniel Convissor danielc at analysisandsolutions.com
Tue Jun 6 16:54:26 EDT 2006


Andrew:

You can keep it static, but the child class must manually modify the 
values as desired rather than setting the property in the child.

class a {
    public static $aa = 'original';
    public static function e() {
        echo self::$aa . "<br/>\n";
    }
}

class b extends a {
    public function m() {
        self::$aa = 'modified';
    }
}

b::m();
b::e();


--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list