So we can define array constants in PHP5.6. However, I got the following error when defining an array constant inside a class
Arrays are not allowed in class constants
So is it true that array constants are allowed but not inside classes?
As of PHP 5.6 arrays are allowed in class constants.
See the link for a working php code.
<?php
class Foo
{
const BAR = [1,2,3];
}
print_r(Foo::BAR);