Editor shows syntax error with correct code (PHP, Javascript)


#1

Apparently the editor is not able to parse PHP code inside a script tag. This causes an error message:

<script>
  var x = "<?php
            echo 'test';
          ?>";
  alert(x);
</script>

And this as well:

<script>
  <?php echo "alert('test');"; ?>
</script>

It only works if the PHP code is inside a string without line breaks:

<script>
  alert("<?php echo 'test'; ?>");
</script>

Parsing error: Unexpected token ? when using PHP inside of script