StanAngeloff / php.vim

An up-to-date Vim syntax for PHP (7.x supported)
477 stars 69 forks source link

CONST value as array (PHP 7) #54

Closed mayppong closed 8 years ago

mayppong commented 8 years ago

In PHP 7, you can now use expressions as class constants. However, the syntax checker is still complaining.

Plinth/src/Contact/Address.php|24 error| Arrays are not allowed in class constants

I would love to see the the plugin support this.

StanAngeloff commented 8 years ago

Hi,

Do you have Syntastic installed as well? The php.vim plug-in does not provide any linting by default.

mayppong commented 8 years ago

I do. I was under the impression that Syntastic uses this plugin for the underlying linting.

StanAngeloff commented 8 years ago

Syntastic will defer to the php executable for linting and phpcs / phpmd for further analysis when configured. This plug-in does syntax highlighting only and does not provide linting.

You may be able to resolve your issue by upgrading the PHP version installed on your computer (be careful when doing so as it may break other things). Arrays in class constants are supported in PHP 5.6+.