I worked with a class where almost 20 constants are defined, since I want all this constant value in an array, I just want to know
is there any method that creates an array of the whole class constant?
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);
source share