Arrays can be used as plain constants and class constants from version PHP 5.6 onwards:
class Answer {
const C = [2,4];
}
print Answer::C[1] . Answer::C[0]; // 42
const ANSWER = [2,4];
print ANSWER[1] . ANSWER[0]; // 42
Also from version PHP 7.0 this functionality was ported to the define
function for plain constants.
define('VALUES', [2, 3]);
define('MY_ARRAY', [
1,
VALUES,
]);
print MY_ARRAY[1][1]; // 3