All class constants can be accessed statically

This commit is contained in:
Jonathan Klein 2015-10-01 07:37:05 -04:00
parent 1717ee9d88
commit 222cfcd15c

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