class Foo {
const BAR = 'Hello';
}
echo Foo::BAR; //Works
echo Foo::BAR[0]; //Parse error: syntax error, unexpected '[', expecting ',' or ';'
I've found a way around this by using substr, but I'm curious to know why this doesn't work as it is.
PHP 5.3.3 by the way.
$foo = Foo::BAR; $foo = $foo[0];