Category
php-in-php · stdlib
Problem
strip_tags() VM path lives in PHP (ext/standard/strip_tags.php, VmString), but JIT/AOT still emit __compiler_strip_tags plus helper symbols from lib/JIT/Builtin/StringStripTagsJit.php (~900 lines, ported from superglobals_refresh.c tag parser). Enum TypeError parity (#5897) and allowed-tags edge cases must be maintained in one PHP implementation, not a parallel LLVM parser.
php-src reference
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "var_export(strip_tags(\"<b>x</b>\", \"<b>\")); echo \"\n\";"
php bin/vm.php -r "var_export(strip_tags(\"<b>x</b>\", \"<b>\")); echo \"\n\";"
php bin/jit.php -r "var_export(strip_tags(\"<b>x</b>\", \"<b>\")); echo \"\n\";" 2>&1
'
VM/JIT should agree; today JIT uses LLVM StringStripTagsJit while VM uses VmString::stripTags().
Scope
| Layer |
Files |
| JIT |
lib/JIT/Builtin/StringStripTagsJit.php — delegate to compiled VmString / strip_tags builtin |
| VM reference |
ext/standard/VmString.php — single source of truth |
| Delete/shrink |
remove __compiler_strip_tags / __phpc_st_* LLVM helpers when PHP path wired |
| Tests |
test/compliance/cases/stdlib/strip_tags*.phpt; enum operand guard #5897 |
PHP-in-PHP first: do not extend C tag tables in runtime/; shrink LLVM when PHP lowering is sufficient.
Done when
Related
Category
php-in-php·stdlibProblem
strip_tags()VM path lives in PHP (ext/standard/strip_tags.php,VmString), but JIT/AOT still emit__compiler_strip_tagsplus helper symbols fromlib/JIT/Builtin/StringStripTagsJit.php(~900 lines, ported fromsuperglobals_refresh.ctag parser). EnumTypeErrorparity (#5897) and allowed-tags edge cases must be maintained in one PHP implementation, not a parallel LLVM parser.php-src reference
ext/standard/string.c—PHP_FUNCTION(strip_tags),php_strip_tags_exRepro
VM/JIT should agree; today JIT uses LLVM
StringStripTagsJitwhile VM usesVmString::stripTags().Scope
lib/JIT/Builtin/StringStripTagsJit.php— delegate to compiledVmString/strip_tagsbuiltinext/standard/VmString.php— single source of truth__compiler_strip_tags/__phpc_st_*LLVM helpers when PHP path wiredtest/compliance/cases/stdlib/strip_tags*.phpt; enum operand guard #5897PHP-in-PHP first: do not extend C tag tables in
runtime/; shrink LLVM when PHP lowering is sufficient.Done when
__compiler_strip_tagsLLVM implementation deleted or thin trampolinelib/JIT/Builtin/StringStripTagsJit.php./script/ci-fast.sh --filter strip_tagsgreenRelated