Category
stdlib · php-src-strict · spec refresh 2026-06-20
Problem
highlight_string() / highlight_file() / show_source() (#3447 ) VM builtins now exist (ext/standard/VmHighlight.php, highlight_string.php, highlight_file.php), but parity is incomplete :
Compile — highlight_file(__DIR__ . '/x.php') fails Expr_MagicScriptConst (Regression: highlight_file()/highlight_string() __FILE__/__DIR__ args still fail compile — re-#9924/#9140 (Zend/zend_compile.c) #9973 ).
Output bytes — highlight_string($code, return: true) returns string but HTML length/markup differs from Zend (Stdlib: highlight_string() HTML markup wrong vs Zend — output length/spans differ (ext/standard/basic_functions.c) #10308 — len 269 vs 340 on maintainer repro).
JIT — lowering exists (JitHighlight.php); must follow VM SSOT after output parity.
Original umbrella tracked missing functions; this spec now tracks remaining php-src-strict gaps .
php-src reference
Repro
Output parity (#10308 ):
test/repro/maintainer_gap_highlight_string_bool.php
./script/docker-exec.sh -- bash -lc ' source script/php-env.sh
php test/repro/maintainer_gap_highlight_string_bool.php
php bin/vm.php test/repro/maintainer_gap_highlight_string_bool.php
'
Compile parity (#9973 ):
test/repro/maintainer_gap_highlight_file_bool.php — VM fails compile on __DIR__ concat today.
Check
Zend
VM today
highlight_string(..., true) len
269
340
highlight_file(__DIR__.'/sample.php', true)
runs
compile fail
Scope (PHP-in-PHP)
Layer
Path
VM
ext/standard/VmHighlight.php, highlight_*.php
Compiler
#9973 magic const in call args
JIT
ext/standard/JitHighlight.php after VM green
Matrix
script/capability-matrix.php
Done when (php-src-strict)
Sub-issues (claim separately)
Related
Category
stdlib· php-src-strict · spec refresh 2026-06-20Problem
highlight_string()/highlight_file()/show_source()(#3447) VM builtins now exist (ext/standard/VmHighlight.php,highlight_string.php,highlight_file.php), but parity is incomplete:highlight_file(__DIR__ . '/x.php')failsExpr_MagicScriptConst(Regression: highlight_file()/highlight_string() __FILE__/__DIR__ args still fail compile — re-#9924/#9140 (Zend/zend_compile.c) #9973).highlight_string($code, return: true)returns string but HTML length/markup differs from Zend (Stdlib: highlight_string() HTML markup wrong vs Zend — output length/spans differ (ext/standard/basic_functions.c) #10308 — len 269 vs 340 on maintainer repro).JitHighlight.php); must follow VM SSOT after output parity.Original umbrella tracked missing functions; this spec now tracks remaining php-src-strict gaps.
php-src reference
ext/standard/basic_functions.c—PHP_FUNCTION(highlight_string),PHP_FUNCTION(highlight_file)ext/standard/php_highlight.h— shared highlighterRepro
Output parity (#10308):
test/repro/maintainer_gap_highlight_string_bool.phpCompile parity (#9973):
test/repro/maintainer_gap_highlight_file_bool.php— VM fails compile on__DIR__concat today.highlight_string(..., true)lenhighlight_file(__DIR__.'/sample.php', true)Scope (PHP-in-PHP)
ext/standard/VmHighlight.php,highlight_*.phpext/standard/JitHighlight.phpafter VM greenscript/capability-matrix.phpDone when (php-src-strict)
highlight_filewith__FILE__/__DIR__operands compiles and runsshow_source()alias parity (Stdlib: show_source() — alias of highlight_file() (ext/standard/url.c parity) #3447) if still open./script/ci-fast.sh --filter highlightgreenSub-issues (claim separately)
Related