Category
bug · AOT · mbstring · leftover of #5957 / #23883
Problem
mb_trim() / mb_ltrim() / mb_rtrim() fold compile-time string literals, then throw at JIT/AOT compile for runtime haystacks:
LogicException: mb_trim() is not lowered for JIT/AOT in this compiler build
Same leftover shape as #34338 (mb_scrub) / #34358 (mb_detect_encoding): NestedJIT runtime path missing.
| Repro |
Zend 8.4+ |
AOT (master) |
$s = " hi "; echo mb_trim($s); |
hi |
LogicException at compile |
php-src reference
PHP implementation target
ext/mbstring/JitMbTrim.php — NestedJIT runtime via helper (peer JitMbScrub)
ext/mbstring/MbTrimJitHelper.php + lib/JIT/Builtin/MbTrimRuntime.php
- Encoding /
$characters stay compile-time literals (NestedJIT array/state constraints)
Repro
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php \$s=\" hi \"; echo mb_trim(\$s), PHP_EOL;" > /tmp/t.php; php bin/compile.php -o /tmp/t.bin /tmp/t.php'
Done when
Category
bug· AOT · mbstring · leftover of #5957 / #23883Problem
mb_trim()/mb_ltrim()/mb_rtrim()fold compile-time string literals, then throw at JIT/AOT compile for runtime haystacks:Same leftover shape as #34338 (mb_scrub) / #34358 (mb_detect_encoding): NestedJIT runtime path missing.
$s = " hi "; echo mb_trim($s);hiphp-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_trim)/mb_ltrim/mb_rtrimPHP implementation target
ext/mbstring/JitMbTrim.php— NestedJIT runtime via helper (peerJitMbScrub)ext/mbstring/MbTrimJitHelper.php+lib/JIT/Builtin/MbTrimRuntime.php$charactersstay compile-time literals (NestedJIT array/state constraints)Repro
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php \$s=\" hi \"; echo mb_trim(\$s), PHP_EOL;" > /tmp/t.php; php bin/compile.php -o /tmp/t.bin /tmp/t.php'Done when
runtime/*.c; NestedJIT PHP helper only