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
Stdlib: highlight_file() emits raw newlines not <br /> between lines (ext/standard/highlight.c) #17557
highlight_file($path, true) should wrap each source line in syntax-colored spans and join lines with <br /> inside a single outer <code> block (Zend). This compiler emits raw newlines inside <span> elements and omits <br /> separators.
Repro
Zend 8.2+
VM (2026-07-09)
highlight_file($f, true) on "line1\nline2\n" — <br count
Fix:HighlightEngine::escapeAndFormat() now converts \n inside highlighted spans to <br />, matching php-src ext/standard/php_highlight.h. Shared by highlight_file(), highlight_string(), and show_source() on VM/JIT/AOT (HighlightJitHelper).
Verification:
VM repro: php bin/vm.php test/repro/maintainer_gap_highlight_file_br.php → br_count=2, raw_nl_in_span=false
Compliance: vendor/bin/phpunit --filter highlight_file_br — OK (VM + JIT)
VmHighlightTest Zend byte-match — OK
AOT: highlight_string() multi-line → br-ok; -l on repro passes
Fix:HighlightEngine now converts newlines to <br /> inside highlight spans (php-src ext/standard/highlight.c) and colors T_INLINE_HTML as default black for plain-text file lines.
Activity
PurHur commentedon Jul 9, 2026
Maintainer repro committed on master:
test/repro/maintainer_gap_*_57*.php— see issue body paths. Bootstrap gates 2026-07-09: link ✅ helloworld ✅ inventory 4311/4311 ✅PurHur commentedon Jul 10, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 10, 2026
claim: cursor-agent-lane-b — starting this run
Stdlib: highlight_file() line breaks use <br /> not raw newlines (#17557
PurHur commentedon Jul 10, 2026
Merged via #17559.
Fix:
HighlightEngine::escapeAndFormat()now converts\ninside highlighted spans to<br />, matching php-srcext/standard/php_highlight.h. Shared byhighlight_file(),highlight_string(), andshow_source()on VM/JIT/AOT (HighlightJitHelper).Verification:
php bin/vm.php test/repro/maintainer_gap_highlight_file_br.php→br_count=2,raw_nl_in_span=falsevendor/bin/phpunit --filter highlight_file_br— OK (VM + JIT)VmHighlightTestZend byte-match — OKhighlight_string()multi-line →br-ok;-lon repro passesMerge origin/master — keep T_INLINE_HTML color + compliance guard (#1…
Stdlib: highlight_file() multiline lines use <br /> not raw newlines (#…
PurHur commentedon Jul 10, 2026
Merged #17560
Fix:
HighlightEnginenow converts newlines to<br />inside highlight spans (php-srcext/standard/highlight.c) and colorsT_INLINE_HTMLas default black for plain-text file lines.Verification:
Fix var_export(isset) wiring, DOM reparent, and highlight_file line b…
Fix var_export(isset) wiring, DOM reparent, and highlight_file line b…