Category
bug · AOT · stdlib · mbstring · NestedJIT leftover
Problem
mb_convert_case(..., MB_CASE_TITLE, $encoding) with a runtime encoding string fails at AOT compile with LogicException: mb_convert_case() encoding must be a string literal. UPPER/LOWER already accept runtime encoding via JitMbCase (#34858). TITLE still requires a compile-time literal (JitMbConvertCase::runtimeEncodingFromCaseArgs).
| Repro |
Zend / VM |
AOT (bin/compile.php) |
$e='UTF-8'; echo mb_convert_case('ab', MB_CASE_UPPER, $e); |
AB |
AB |
$e='UTF-8'; echo mb_convert_case('ab', MB_CASE_TITLE, $e); |
Ab |
compile fails LogicException |
echo mb_convert_case('istanbul', MB_CASE_TITLE, 'UTF-8'); |
Istanbul |
Istanbul |
php-src reference
PHP implementation target
Repro
./script/aot-smoke.sh # must stay 8/8
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php" "\$e=\"UTF-8\";" "echo mb_convert_case(\"ab\", MB_CASE_TITLE, \$e);" > /tmp/t.php; php /tmp/t.php; php bin/vm.php /tmp/t.php; php bin/compile.php -o /tmp/t.bin /tmp/t.php && /tmp/t.bin; echo'
Done when
Parent / peers
Category
bug· AOT · stdlib · mbstring · NestedJIT leftoverProblem
mb_convert_case(..., MB_CASE_TITLE, $encoding)with a runtime encoding string fails at AOT compile withLogicException: mb_convert_case() encoding must be a string literal. UPPER/LOWER already accept runtime encoding viaJitMbCase(#34858). TITLE still requires a compile-time literal (JitMbConvertCase::runtimeEncodingFromCaseArgs).bin/compile.php)$e='UTF-8'; echo mb_convert_case('ab', MB_CASE_UPPER, $e);ABAB$e='UTF-8'; echo mb_convert_case('ab', MB_CASE_TITLE, $e);Abecho mb_convert_case('istanbul', MB_CASE_TITLE, 'UTF-8');IstanbulIstanbulphp-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_convert_case)Argument Stdlib: ceil, floor, intval and expanded PHPT specs #3$encodingPHP implementation target
ext/mbstring/JitMbConvertCase.php— TITLE path: NestedJIT encoding ptr + assert (peerJitMbCase::encodingPtr/ AOT: mb_strtolower()/mb_strtoupper()/mb_ucfirst()/mb_lcfirst() refuse runtime encoding — LogicException (leftover of #34625, ext/mbstring/mbstring.c) #34858)ext/mbstring/MbConvertCaseJitHelper.php+lib/JIT/Builtin/MbConvertCaseRuntime.php—assertEncodingArgvwith Argument Stdlib: ceil, floor, intval and expanded PHPT specs #3Repro
Done when
ValueErrorArgument Stdlib: ceil, floor, intval and expanded PHPT specs #3 (not LogicException / SIGSEGV)./script/aot-smoke.shstill 8/8./script/phpunit.sh --filter MbConvertCaseRuntimeAotTestParent / peers