Possible duplicate:
Can I get CONST in a PHP class?
class ApplicationMode
{
const production = 0;
const development = 1;
const testing = 2;
public function getApplicationModes()
{
return get_class_vars('ApplicationMode');
}
}
I have such a class, and in the getApplicationModes method I would like to return a list of all constants as an array (key => value). The problem is that get_class_vars does not list constants. is there any way to get a list of all class constants?
user243901
source
share