(PHP) Syntax parsing breaks inside parameters of some function calls
Describe the issue
When a lambda function is used as a parameter, it breaks down if it has a use section after its parameters.
Comments break inside object method calls (but apparently not regular function calls).
Which language seems to have the issue? PHP
Are you using highlight or highlightAuto?
I noticed it on Stack Overflow, and confirmed with highlightElement in your demo pages.
Sample Code to Reproduce

Expected behavior
funky(
'string',
function(array $x) use ($y) {
# $y above fails to parse as a var, and this comment is broken
$x[] = $y
return $x;
}
);
$o->m([
'foo',
# this comment highlights keywords like include and 'string' literals
'bar',
]);
With #4230 I am fixing the C line comments (// comment). But I guess the patch should also fixes the comments starting with # :)
Yes, let us know if #4230 does the trick.
Do you have a sandbox to test in? If not, can you just paste the snippet above into your build to see if it's fixed?
With #4230 I am fixing the C line comments (
// comment). But I guess the patch should also fixes the comments starting with#:)
After I have left that comment above, I have amended my pull request to add support for hash comments. The diff can be seen at https://github.com/highlightjs/highlight.js/compare/80f3fa7bee289cbdb21277da1f0e0e216559d6bd..6060d5c68794ed43f2e036d0607404b7e33264b8 and it adds a test to validate that hash comment contained within a function is rendered as a comment span :)