1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-01 12:30:48 +02:00

Added visibility to static variable declarations

This commit is contained in:
Rob Vella
2013-08-12 17:34:17 -07:00
parent bd48b7062c
commit bbb8c83745

View File

@@ -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;