Category
stdlib — implementation-ready (VM landed; JIT + compliance remain)
Status (2026-06-18 audit)
grapheme_str_split() is registered on VM (ext/intl/grapheme_str_split.php, VmGrapheme). function_exists('grapheme_str_split') → true on bin/vm.php.
Still open for this issue:
Problem
grapheme_str_split() splits on grapheme cluster boundaries (combining characters stay attached). Apps expect it alongside grapheme_strlen() / grapheme_substr() (#3352).
php-src reference
Repro — existence (VM green)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(function_exists(\"grapheme_str_split\")); echo \"\\n\";"'
# bool(true)
Repro — behavior (compare Zend + VM)
Use committed maintainer script test/repro-maintainer/grapheme_str_split_missing.php:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro-maintainer/grapheme_str_split_missing.php
php bin/vm.php test/repro-maintainer/grapheme_str_split_missing.php'
Expected Zend + VM (php-src-strict):
| Case |
Output shape |
"e\xCC\x81" (one grapheme) |
array(1) { [0]=> string(3) … } |
'abc' |
three single-char graphemes |
'abcdef', 2 |
chunks of 2 graphemes |
Repro — JIT gap
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/jit.php test/repro-maintainer/grapheme_str_split_missing.php 2>&1 | head -5'
# deferred / not implemented — must not segfault
Scope (this repo)
PHP-in-PHP: ICU/cluster logic in ext/intl/ PHP, not runtime/*.c.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter grapheme_str_split'
./script/ci-fast.sh --filter grapheme_str_split
Related
Category
stdlib— implementation-ready (VM landed; JIT + compliance remain)Status (2026-06-18 audit)
grapheme_str_split()is registered on VM (ext/intl/grapheme_str_split.php,VmGrapheme).function_exists('grapheme_str_split')→ true onbin/vm.php.Still open for this issue:
$lengthchunkingTypeError(Stdlib: grapheme_*() — enum case string operands must TypeError (ext/intl/grapheme) #5914)Problem
grapheme_str_split()splits on grapheme cluster boundaries (combining characters stay attached). Apps expect it alongsidegrapheme_strlen()/grapheme_substr()(#3352).php-src reference
ext/intl/grapheme/grapheme_string.c—PHP_FUNCTION(grapheme_strsplit)(PHP name:grapheme_str_split)ext/intl/grapheme/grapheme_util.c— cluster iterationRepro — existence (VM green)
Repro — behavior (compare Zend + VM)
Use committed maintainer script
test/repro-maintainer/grapheme_str_split_missing.php:Expected Zend + VM (php-src-strict):
"e\xCC\x81"(one grapheme)array(1) { [0]=> string(3) … }'abc''abcdef', 2Repro — JIT gap
Scope (this repo)
ext/intl/grapheme_str_split.php— VM ✅; addJitGraphemeStrSplitloweringext/intl/VmGrapheme.php— shared cluster iterator (reuse for strlen/substr)ext/intl/Module.php— registration ✅test/compliance/cases/stdlib/grapheme_str_split.phpt(new)PHP-in-PHP: ICU/cluster logic in
ext/intl/PHP, notruntime/*.c.Done when
test/repro-maintainer/grapheme_str_split_missing.phpmatches Zend on VM (all three cases)test/compliance/cases/stdlib/grapheme_str_split.phptgreenphp script/capability-matrix.phpregeneratedVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter grapheme_str_split' ./script/ci-fast.sh --filter grapheme_str_splitRelated