Answer the question
In order to leave comments, you need to log in
Expecting statement in phpStorm when using alternate control structure syntax. How to win?
Essence of the question - When using the alternative syntax of the if control structure on the example:
<?php if ($var) : ?>
<!--html code -->
<?php else : ?>
<!--html code -->
<?php endif; ?>
<?php if ($var) { ?>
<!--html code -->
<?php } else { ?>
<!--html code -->
<?php } /* if ($var) */?>
Answer the question
In order to leave comments, you need to log in
There is such a problem, you can reproduce it as follows
<? if (....): ?>
....
<? endif: ?>
<? if (....): ?>
....
<? else: ?>
....
<? endif ?>
That's why it is a smart IDE, something means the above is wrong. Maybe, for example, endforeach is in the wrong place
I never noticed it myself, apparently because I immediately build the necessary logic and nothing is highlighted. I heard about this bug from a colleague, looked into the bug tracker - voila, the problem is as old as the world . It has not been treated for years, although it is marked as a major issue.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question