In PHP docs there is an example that uses public const http://php.net/manual/en/language.oop5.visibility.php#example-196
class MyClass
{
public const MY_PUBLIC = 'public';
}
But it gives me this error: "Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /Applications/MAMP/htdocs/php-testing/const.php on line 5"
This example works without "public". Like this
class MyClass
{
const MY_PUBLIC = 'public';
}
What am I doing wrong?