1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-07-31 20:10:49 +02:00

Merge pull request #1268 from jklein/patch-1

All class constants can be accessed statically
This commit is contained in:
Levi Bostian
2015-10-02 11:13:21 -05:00

View File

@@ -495,7 +495,9 @@ class MyClass
}
}
// Class constants can always be accessed statically
echo MyClass::MY_CONST; // Outputs 'value';
echo MyClass::$staticVar; // Outputs 'static';
MyClass::myStaticMethod(); // Outputs 'I am static';