mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Merge pull request #200 from deftx/master
Added visibility to static variable declarations
This commit is contained in:
commit
d7823eab22
@ -440,6 +440,11 @@ class MyClass
|
||||
|
||||
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
|
||||
public $property = 'public';
|
||||
public $instanceProp;
|
||||
|
Loading…
Reference in New Issue
Block a user