New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token error defining constant array in php56 #280
Comments
Can you prepare a reduced code example that triggers that errors so we can test it? |
Yes, sure :) class Test
{
const TYPE = 'type';
const ARRAY_CONST = [
self::TYPE => 0 // This line generate the error
];
} |
Does it work with the old array syntax? const ARRAY_CONST = array(
self::TYPE => 0
); |
This issue is related to PDepend issue pdepend/pdepend#192 |
It trigger the same error with the old array syntax too. class Test
{
const TYPE = 'type';
const ARRAY_CONST = array(
self::TYPE => 0 // This line generate the error
);
} |
Fixed since phpmd@2.3.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I try to define a constant array using the const keyword (http://php.net/manual/en/migration56.new-features.php) phpMD (version 2.2.2) generate a "Unexpected token: =>" error.
The text was updated successfully, but these errors were encountered: