Re: Syntax problem - dynamic static member access

From: Date: Sun, 07 Nov 2004 07:09:19 +0000
Subject: Re: Syntax problem - dynamic static member access
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-201403@lists.php.net to get a copy of this message
Jake, as you probably already know you usually have to give the class name when attempting to get a static variable, i.e. YourClassName::$bob; You *can* dynamically refer to a static class variable from within an object without knowing the name of the class; this is what self is for. i.e. class YourClassName { function getStatic($var) {
    return self::$var;
} }

« previous php.general (#201403) next »