create an array of all constant of a class?
问题 I was working with a class where almost 20 constant are defined, as i want all these constant value in an array, i just want to know is there any method which create an array of all constant of a class? I tried with compact BUT it does not work with constants. class Alpha { const ONE = 'fixone'; const TWO = 'fix_two'; const THREE = 3 public function __construct() { protected $arr_constant = compact(ONE,TWO,THREE); // gives FATAL Error // is there any method which collect all consant and