Real Dreams
Real Dreams

Reputation: 18010

PhpStorm marks valid code as invalid

Consider the following code snippet.

$foo = new stdClass();
$foo->fn = function () {};
($foo->fn)();

PhpStorm 2016.1 marks the last line invalid, while I have set the PHP language level to version 7. Is there any config or is it a bug?

Upvotes: 1

Views: 79

Answers (2)

Real Dreams
Real Dreams

Reputation: 18010

Thankfully, the issue has been solved in 2016.2 version.

https://blog.jetbrains.com/phpstorm/2016/07/php-7-support-in-phpstorm-2016-2/

Upvotes: 0

LazyOne
LazyOne

Reputation: 165088

Unfortunately this particular PHP7 syntax/functionality is still not supported.

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

Upvotes: 2

Related Questions