From 222cfcd15c7539fd4d2340e5e70cbf3f6b6e087b Mon Sep 17 00:00:00 2001 From: Jonathan Klein Date: Thu, 1 Oct 2015 07:37:05 -0400 Subject: All class constants can be accessed statically --- php.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index 2d4565e0..5cc6a785 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -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'; -- cgit v1.2.3