feat: add PHP mb_convert_case and MB_CASE_* constants - #902
Open
nahime0 wants to merge 14 commits into
Open
Conversation
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Declare the PHP 8.5 signature in the shared builtin catalog, add the AOT checker home file, and implement Magician/eval with UTF-8 title case, final sigma, and iconv encodings. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add the shared AOT case-mapping tables, Case_Ignorable ranges, and titlecase/final-sigma helpers used to emit the runtime convert tables. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Lower mb_convert_case through RuntimeFnId, gate __rt_mb_convert_case on both supported targets, and convert UTF-8/8bit/iconv encodings with the PHP 8.5 MB_CASE_* tables. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Full fold expands ß and alphabetic ligatures instead of reusing lowercase, matching PHP 8.5 on AOT and Magician. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add codegen, eval-parity, Magician, metadata, and type/arity tests for title case, all MB_CASE_* modes, encodings, and ValueErrors. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add the PHP 8.5 signature, title-case example, predefined constants, string-ops demo, and a delivered ROADMAP item. 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>
Title-casing "hié" correctly leaves the trailing é lowercase, so the latin1 check now verifies UPPER maps 0xE9 to 0xC9. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
A 64-bit map_len at rbp-232 shared four bytes with the emit index at rbp-228, so incrementing the index inflated the length and SIGSEGV'd on the next mapped-code load. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
nahime0
marked this pull request as ready for review
September 5, 2026 10:53
|
Too many files changed for review (298 files, 100 file limit). Bypass the limit by tagging |
AArch64 apply/sigma-ahead nested bl clobbered the convert-loop return address and hung. x86_64 frameless entries now pad rsp so the System V call-alignment audit stays green. 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>
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.
Summary
Adds PHP 8.5
mb_convert_case()and theMB_CASE_*constants on both the AOT backend and Magician/eval. Termwind Stylescapitalizecallsmb_convert_case(..., MB_CASE_TITLE, 'UTF-8').This change covers only
mb_convert_caseplus the eightMB_CASE_*modes. It does not addmb_strwidth,mb_strimwidth,mb_strtoupper, ormb_strtolower.Behavior
mb_convert_case(string $string, int $mode, ?string $encoding = null): stringMB_CASE_UPPER/LOWER/TITLE/FOLDand the*_SIMPLEvariants (0..=7)Cased/Case_Ignorablestate (apostrophe stays inside the word:"don't"→"Don't")ß→SS/ titleSs/ foldss); simple mappings stay 1:1MB_CASE_LOWERandMB_CASE_TITLEonlyUTF-8/UTF8convert Unicode;8bit/binary/7bittreat bytes asU+00xx; other names go through iconvValueErrorImplementation
builtin!home fileeval_builtin!with the same convert algorithm__rt_mb_convert_caseon linux-x86_64 and AArch64, gated byRuntimeFeaturescharmappings plus Unicode 16Case_Ignorablerangesmap_lenand the emit index are packed 32-bit stack slots so they do not overlapTests and docs
examples/string-ops,docs/php/strings.md,docs/php/namespaces.md, ROADMAP, and generated builtin pagesFocused host verification (
linux-x86_64): AOT title/modes/encoding tests, eval parity, error tests, and the string-ops Case example all pass. CI covers the remaining supported-target matrix.