mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-14 05:05:59 +00:00
All class constants can be accessed statically
This commit is contained in:
parent
1717ee9d88
commit
222cfcd15c
@ -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';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user