As of PHP 5.6, it is possible to declare constant arrays. The linked documentation uses the example const ARR = ['a', 'b'];
. You could also do const ARR = array('a', 'b');
. However, in 5.6 there is an odd quirk: you can declare constant arrays using const
, but not define()
. This has been corrected in PHP 7.0.