Branden
Branden

Reputation: 237

Getting rid of errors from using arrays as constants

So, as you may know, in PHP 5.6+, you can use arrays as constants. e.g.:

const MEMBER_TYPES = array("User", "Moderator", "Admin");

However, in my PHPStorm installation, I get an error when doing this, even though when running the code I get no errors at all, using PHP 5.6.8. None of the inspections I'm seeing via Alt+Enter are doing anything.. is there a way to suppress this specific error detection?

Upvotes: 3

Views: 692

Answers (2)

JD.
JD.

Reputation: 3035

Reported as fixed in 10.0.2 by PhpStorm folks. https://youtrack.jetbrains.com/issue/WI-26366#comment=27-1257245

Upvotes: 0

LazyOne
LazyOne

Reputation: 165118

This functionality is not yet supported by PhpStorm

https://youtrack.jetbrains.com/issue/WI-26366 -- watch this ticket (star/vote/comment) to get notified on progress.

Upvotes: 1

Related Questions