Category
php-in-php · php-src-strict
Problem
VM preg_match() / preg_replace() / related PCRE builtins run through ext/pcre/ PHP (VmPcre.php, per-function wrappers). JIT/AOT still ship a ~3k-line LLVM runtime in lib/JIT/Builtin/StringPregMatchJit.php calling libpcre2-8 directly — duplicating error codes, offset capture, enum-subject guards (#9029), and JIT stack limits already handled in PHP.
This grows native link surface and diverges from the VM path workers fix for parity issues.
php-src reference
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(preg_match(\"/\\\\d+/\", \"abc123\")); echo PHP_EOL;"
php bin/jit.php -r "var_export(preg_match(\"/\\\\d+/\", \"abc123\")); echo PHP_EOL;"
# JIT: StringPregMatchJit.php libpcre2 LLVM (issue #5289)'
Scope
| Layer |
Path |
| JIT LLVM |
lib/JIT/Builtin/StringPregMatchJit.php — shrink to trampoline into compiled PHP |
| Lowering |
ext/pcre/JitPreg*.php handlers |
No new runtime/*.c — delete/shrink pcre2 LLVM when PHP path suffices |
|
| Pairs enum/subject parity issues #9029, #9025–#9026 |
|
Done when
Ref: #1492, #5289, #9029
Category
php-in-php· php-src-strictProblem
VM
preg_match()/preg_replace()/ related PCRE builtins run throughext/pcre/PHP (VmPcre.php, per-function wrappers). JIT/AOT still ship a ~3k-line LLVM runtime inlib/JIT/Builtin/StringPregMatchJit.phpcalling libpcre2-8 directly — duplicating error codes, offset capture, enum-subject guards (#9029), and JIT stack limits already handled in PHP.This grows native link surface and diverges from the VM path workers fix for parity issues.
php-src reference
ext/pcre/php_pcre.cext/pcre/VmPcre.php,ext/pcre/preg_match.php, …Repro
Scope
lib/JIT/Builtin/StringPregMatchJit.php— shrink to trampoline into compiled PHPext/pcre/JitPreg*.phphandlersruntime/*.c— delete/shrink pcre2 LLVM when PHP path sufficesDone when
preg_match/preg_replace/preg_splitmatch VM + Zend on compliance pcre PHPTsRef: #1492, #5289, #9029