Conversation
Share East Asian Width ranges and character_width() in the builtin contract so AOT and Magician cannot drift. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Reuse the strlen eval hook family and apply the shared PHP 8.5 width table, including encoding aliases and catchable ValueError. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Lower mb_strwidth through the same encoding ABI as mb_strlen and emit __rt_mb_strwidth plus a shared East Asian Width lookup. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add display-width, encoding, malformed UTF-8, and function_exists coverage, plus a string-ops example. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
nahime0
marked this pull request as ready for review
September 5, 2026 10:30
|
Too many files changed for review (282 files, 100 file limit). Bypass the limit by tagging |
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds PHP
mb_strwidth()on both AOT and Magician/eval(), matching PHP 8.5 East Asian Width for UTF-8 and the same encoding argument rules asmb_strlen().Why
Termwind layout (
Styles::getLengthand related width math) needsmb_strwidth. Elephc mbstring previously exposed onlymb_strlenandmb_ereg_match.What
mbfl_eaw_table+character_width()inelephc-builtin-contractbuiltin!home, Magicianeval_builtin!hook__rt_mb_strwidth/__rt_mb_char_widthon every supported target, gated with the existingmb_strlenruntime familyUTF-8/UTF8,8bit/binary/7bit), iconv-backed names, catchableValueErrorfor unknown encodingsexamples/string-opsdemodocs/php/strings.md, runtime internals, and ROADMAPScope
Only
mb_strwidth. No othermb_*functions.Verification
Focused tests are green locally on
linux-x86_64:cargo test --test codegen_tests test_mb_strwidth(4 tests)cargo test --test codegen_tests test_eval_mb_strwidthcargo test --test error_tests test_error_mb_strwidth(3 tests)execute_program_dispatches_mb_strwidth_builtinfunction_exists('mb_strwidth')and first-classmb_strwidth(...)on AOT and evalextract_builtins, audit, site compat, EIR boundary,gen_php_comparison)CI covers the full supported-target matrix.
Focused test log
AOT and eval demo
To show artifacts inline, enable in settings.