mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Added visibility to static variable declarations
This commit is contained in:
parent
bd48b7062c
commit
bbb8c83745
@ -440,6 +440,11 @@ class MyClass
|
|||||||
|
|
||||||
static $staticVar = 'static';
|
static $staticVar = 'static';
|
||||||
|
|
||||||
|
// Static variables and their visibility
|
||||||
|
public static $publicStaticVar = 'publicStatic';
|
||||||
|
private static $privateStaticVar = 'privateStatic'; // Accessible within the class only
|
||||||
|
protected static $protectedStaticVar = 'protectedStatic'; // Accessible from the class and subclasses
|
||||||
|
|
||||||
// Properties must declare their visibility
|
// Properties must declare their visibility
|
||||||
public $property = 'public';
|
public $property = 'public';
|
||||||
public $instanceProp;
|
public $instanceProp;
|
||||||
|
Loading…
Reference in New Issue
Block a user