Checking for missing brackets doesn't work

I'm new to phpStorm and thought I would try it out. One of the things I find important for a php IDE to do it find missing brackets.

I thought I'd just do a simple test on how well it could find a missing '}' bracket. See my attached image. It failed to find it. This is a small, simple test.php file.

Did I not do something right in trying to get phpStorm to find the missing cracket or is phpStrom just not able to do it (despite the developers saying that it can)?



Attachment(s):
0.jpg
0
5 comments

From the PHP language's point of view (and PhpStorm as a PHP IDE), firstly, it is a "missing statement" before an else operator. Then, all done right on your screenshot.

0

Well, as far as I see there is an error message...
Please elaborate  what message did you expect to get from IDE, at what point in code and why do you think current behavior is wrong.

0

I expected one of two things from phpStorm:

1. Find and set the cursor on the line where the missing "{" bracket is.

or

2. Find and display the line number where the missing "{" bracket is.

phpStorm did not do either one. Therefore, advertising that phpStorm can "locate missing brackets" means it has a bug since it can't find a missing bracket in a simple php file.

0

Missing statements are irrelevant. I'm checking for missing brackets. phpStorm has a find missing brackets feature so that's what I'm testing and it failed to find the missing bracket.

This is a valid php statement:

if ($php_flag == 0)
   {

   }
else
   {
     print 'test';
   }

This is not a valid php statement:

if ($php_flag == 0)
   {


else
   {
     print 'test';
   }

phpStorm should have been able to flag the offending line number.

0

Please sign in to leave a comment.