mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03: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