diff options
author | Ian Bertolacci <ian.bertolacci@gmail.com> | 2015-10-02 10:15:08 -0600 |
---|---|---|
committer | Ian Bertolacci <ian.bertolacci@gmail.com> | 2015-10-02 10:15:08 -0600 |
commit | 53790a00980f0ab58efeea5a20c97366daeca401 (patch) | |
tree | 60cced8d7b62becacd31b6fb56d9a7c41f1de809 /php.html.markdown | |
parent | 938720074b8b18a9ada93fb8a040b9ca1a813747 (diff) | |
parent | d5b5b19ca909b573d0b0623604f1ff9369ab04ff (diff) |
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/php.html.markdown b/php.html.markdown index 2d4565e0..3fcce264 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -487,7 +487,7 @@ class MyClass * Declaring class properties or methods as static makes them accessible without * needing an instantiation of the class. A property declared as static can not * be accessed with an instantiated class object (though a static method can). -*/ + */ public static function myStaticMethod() { @@ -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'; |