Javascript code in PHP file without the <script> tag

Working with Zend Framework 2 using PhpStorm IDE, when using viewhelpers like inlineScript the syntax highlighting don't work properly:

PhpStorm - code injection

The solution: use HEREDOC

To get PhpStorm code injection to work use HEREDOC to wrap the JavaScript code.

PhpStorm - code injection - Edit Javascript Fragment

Now not only the syntax highlighting works fine, but in PhpStorm you can use "Edit JavaScript Fragment" to edit the JavaScript code and use code completion and other PhpStorm tools.