Possible duplicate:Is it possible to declare an array as a constant
Is it possible to use an array as a class constant in PHP ?
Ie
const MYARRAY = array('123', '234');
If not?
No, you cannot assign Array to a PHP constant.
At http://www.php.net/manual/en/language.constants.syntax.php
Constants can only evaluate scalar values
That's why.
Scalar values ββfor examples: int , float , string
int
float
string
No, you canβt.
But you can declare it as a static property.
public static $MYARRAY = array('123', '234');
--------------- Update -----------------------------
Array const is available from PHP 5.6.
php.net/manual/en/migration56.new-features.php