Posts Tagged ‘variable’
Accessing Static Variable within Static method in a Class
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;
-
}
-
}