Method to highlight php closing tag before new line character

This catches me every time:

Hello<? ?>

...after PHP-parsing becomes this:


This is okay for HTML but for plain text (bash/css/config) files it's a pain in the butt.  In order for it to work you need a space after the closing tag, eg:

Hello<? ?>*space*

It'd be nice if there was a way to highlight the closing tag when used before a new line to make this situation more obvious.  Any ideas how to configure this in PhpStorm?

1 comment
Comment actions Permalink

Hi there,

No, IDE does not allow such customisation.

What you can try is create your own (custom) rules for CodeSniffer and use it (PhpStorm has good integration with CodeSniffer). It will not highlight it differently, but will mark such place as problematic (warning) so it will catch your attention.

Other than that -- try Find in page (Ctrl+F) and use some regex to find such spots manually before you submit your script(s) to production.


Please sign in to leave a comment.