PHP Syntax Highlighting issue

A short while ago, something was changed with PHP syntax highlighting. Now it appears to be required to always write

// …

i.e. including the PHP open tag - otherwise the following PHP code will not actually be syntax highlighted.

Why was this changed? It’s an unnecessary nuissance and semantically wrong in my opinion. Most of the time you are posting snippets and examples of PHP code, not fully fledged classes from beginning to end. Thus it is a bit weird if you simply show parts of your class, without any use statements, but having to include <?php nonetheless. Also it is common (at least in the Symfony documentation for example) to not include the <?php open tag in code examples.

Hi @fritzmg,

Thanks for the feedback, we have an issue open in the linguist repository and are working on a fix. Apologies for the inconvenience. Here is that issue if you’d like to follow along:

1 Like

Thank you :slight_smile:

I did try to search for any existing issues - however I find it hard to Google for any issues related to GitHub itself, since that would just show a lot of different GitHub repositories in the search result :grin:

1 Like