Use self to access static variable or const within a class.
example:
-
class static_class {
-
-
private static static_variable = 'I am static ';
-
public static function getStaticVariable() {
-
self::$static_variable;
-
}
-
}
Use self to access static variable or const within a class.
example:
This entry was posted on Sunday, May 31st, 2009 at 9:56 am and is filed under OOP, PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Fusion theme by digitalnature | powered by WordPress
Entries (RSS) and Comments (RSS)