You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lexer: ?> inside a // line comment does not end PHP mode #447
In PHP, a single-line comment (// or #) ends at a newline or at ?>; the close tag then switches to inline HTML. Manticore appears to treat the whole line as a comment and keeps compiling the file as PHP.
Found in manticore-fmt: src/Rule/ControlStructureBraces.php (before the fix) had
// getPrevNonWhitespace: the last comment of the gap before `?>`, else the token before it
Zend reads ?> there as T_CLOSE_TAG and the rest of the line as inline HTML. Manticore compiled the file without complaint, so the divergence only surfaced when manticore-fmt (which follows PHP semantics) formatted it and put blank lines before <?php, changing the output of the built binary.
Expected: either follow PHP (end PHP mode at ?> in a line comment) or report a diagnostic for a source whose ?> inside a line comment changes how Zend would read it.
Repro:
<?php// see `?>` here
echo "x\n";
php prints here\n as inline HTML and then x is not executed as PHP... (the line after ?> is HTML text, echo is output verbatim). Manticore runs the echo.
Activity
Bug sweep: lexer, reference cells, hooks, reflection, array_splice (#428
blacktrs commentedon Oct 26, 2026
Fixed in cd3558d (merged via PR #461).
Bug sweep 4: crashes, named args and spread, typed properties, hooks,…