Category
stdlib
Problem
Only mb_strlen() is registered (ext/types/mb_strlen.php). Multibyte string manipulation — required for UTF-8 web apps and #3222 charset work — is missing:
mb_substr, mb_strpos, mb_strrpos, mb_strtolower, mb_strtoupper
mb_strlen with explicit encoding (verify parity)
php-src reference
ext/mbstring/mbstring.c — php_mb_substr, php_mb_strpos, case conversion
ext/mbstring/php_unicode.c — UTF-8 codepoint iteration
ext/standard/basic_functions.c — strlen fallback when mbstring disabled
Repro (today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_dump(function_exists(\"mb_substr\"));"
php bin/vm.php -r "echo mb_substr(\"café\", 0, 2, \"UTF-8\");"
'
Zend PHP (mbstring): bool(true); prints ca (or codepoint-safe slice per encoding)
This compiler: Call to undefined function mb_substr()
Compare with working mb_strlen:
php bin/vm.php -r "echo mb_strlen(\"café\");"
Scope (this repo)
| Layer |
Files |
Notes |
| VM |
ext/types/mb_substr.php, VmMbstring.php |
UTF-8 v1 via mb_* polyfill or host ext/mbstring when embedding Zend for dev |
| Module |
ext/types/Module.php or ext/standard/Module.php |
Register mb_* family |
| JIT |
defer |
VM-only v1 |
| Tests |
test/compliance/cases/mb_substr_utf8.phpt |
Non-ASCII fixtures |
v1 encoding: UTF-8 only; other encodings → ValueError or documented subset.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter mb_substr'
Dependencies
Links
Category
stdlibProblem
Only
mb_strlen()is registered (ext/types/mb_strlen.php). Multibyte string manipulation — required for UTF-8 web apps and #3222 charset work — is missing:mb_substr,mb_strpos,mb_strrpos,mb_strtolower,mb_strtouppermb_strlenwith explicit encoding (verify parity)php-src reference
ext/mbstring/mbstring.c—php_mb_substr,php_mb_strpos, case conversionext/mbstring/php_unicode.c— UTF-8 codepoint iterationext/standard/basic_functions.c—strlenfallback when mbstring disabledRepro (today)
Zend PHP (mbstring):
bool(true); printsca(or codepoint-safe slice per encoding)This compiler:
Call to undefined function mb_substr()Compare with working
mb_strlen:php bin/vm.php -r "echo mb_strlen(\"café\");"Scope (this repo)
ext/types/mb_substr.php,VmMbstring.phpmb_*polyfill or hostext/mbstringwhen embedding Zend for devext/types/Module.phporext/standard/Module.phptest/compliance/cases/mb_substr_utf8.phptv1 encoding: UTF-8 only; other encodings →
ValueErroror documented subset.Done when
mb_substr('café', 0, 2, 'UTF-8')matches Zend on VMmb_strpos,mb_strtolowerregistered with compliance PHPTs./script/ci-fast.sh --filter mb_substrgreendocs/capabilities.mdlists mb_* rowsVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter mb_substr'Dependencies
iconv/mb_convert_encoding— complementary charset stackext/types/mb_strlen.php— share helper moduleLinks
lib/benefit from mb_* in compiled runtime