Page MenuHomePhabricator

Incorrect syntax highlighting for PHP when using <script language='PHP'>
Closed, WontfixPublic

Description

Example:

<script language='PHP'>
var_dump('foo');
?>
bar
<?php
var_dump('herp');
</script>
derp

Both var_dump() calls hsould be highlighted as PHP.

Or, in paste with language set:

https://secure.phabricator.com/P1174

Event Timeline

fe raised the priority of this task from to Needs Triage.
fe updated the task description. (Show Details)
fe added a subscriber: fe.
epriestley triaged this task as Wishlist priority.Jun 11 2014, 7:04 PM
epriestley added a subscriber: epriestley.

Doesn't seem specific to php.

See P1694 for a paste that's tagged as remarkup but doesn't seem to render or highlight.

@epriestley I can add <script language="PHP">... support to XHPAST if you'd like, but since it's removed from PHP7 and never was really mainstream I don't believe it's worth the effort.

epriestley claimed this task.

Ah, interesting. I wasn't aware it was gone in PHP7. Given that, I agree that this probably isn't worth supporting (I've never seen this syntax in the wild myself).

I'm not completely opposed to supporting it at some point in the future if there's a stronger/more specific motivation than syntax highlighting -- likely some large codebase which is full of it and a desire to eliminate it safely by using lint/AST transformations -- but I suspect that day will never come.