Skip to content

php-in-php: route JIT strip_tags through StripTagsJitHelper (#9196) - #9597

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-strip-tags-9196
Jun 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-strip-tags-9196

Conversation

@PurHur

@PurHur PurHur commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route JIT __compiler_strip_tags through compiled StripTagsJitHelper PHP (self-contained tag parser mirroring VmString::stripTags, php-src ext/standard/string.c).
  • Rename StringStripTagsJit.php → StringStripTagsStandaloneLlvm.php and gate to LOAD_TYPE_STANDALONE only (AOT native link; same pattern as LastErrorRuntime / LastErrorRuntimeLlvm).
  • Delete default JIT LLVM tag-parser path from StringStripTags.php; add shrink/standalone unit guards.

php-src reference

  • php/php-src ext/standard/string.c — PHP_FUNCTION(strip_tags), php_strip_tags_ex
  • PHP SSOT: ext/standard/VmString.php (VM); JIT runtime: ext/standard/StripTagsJitHelper.php

C runtime shrink

  • lib/JIT/Builtin/StringStripTagsJit.php removed from default JIT link (renamed/gated to standalone-only StringStripTagsStandaloneLlvm.php)
  • JIT path: thin bridge in lib/JIT/Builtin/StringStripTags.php → compiled PHP helper

Verification

./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\";"'
# '<b>x</b>' on Zend, VM, JIT

php vendor/bin/phpunit --filter "StripTags|SuperglobalsStripTags"
# OK (4 tests, 14 assertions)

php vendor/bin/phpunit --filter strip_tags_jit
# OK (2 tests)

php vendor/bin/phpunit --filter "AotTest.*strip_tags[^_]"
# OK (1 test)

Closes #9196

Made with Cursor

JIT modules call compiled StripTagsJitHelper PHP (mirrors VmString::stripTags)
instead of the default LLVM tag parser; AOT standalone keeps StringStripTagsStandaloneLlvm
until native link can host compiled helpers reliably (LastErrorRuntime pattern).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php-in-php: JIT StringStripTagsJit — route strip_tags() through VmString PHP not superglobals_refresh LLVM (#1492)

1 participant