Conversation
Declare PHP mb_strimwidth() in the builtin catalog and AOT home file, matching the string/start/width plus optional marker and encoding surface. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add the eval builtin, PHP 8.5 East Asian Width table, and ValueError handling for unknown encodings and out-of-range start/width. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Emit __rt_mb_strimwidth for every supported target, including the PHP 8.5 EAW table, and lower the typed RuntimeFnId through the EIR backend. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Cover ASCII/CJK trim, encoding aliases, first-class callables, Magician eval parity, and compile-time arity/type errors. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Add the PHP reference row, string-ops example, roadmap item, and the generated catalog pages for the new builtin. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Keep the AArch64 walker comments at column 81 and derive Debug so the Magician unit tests can unwrap trim results. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
nahime0
marked this pull request as ready for review
September 5, 2026 10:34
|
Too many files changed for review (279 files, 100 file limit). Bypass the limit by tagging |
Save the pre-decode cursor before next clobbers x9 so a rejected character rewinds instead of reserving a huge concat size. Pad the x86_64 helper frame and skip walker so libc calls stay 16-byte aligned. 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>
Negative width plus a non-zero start must subtract the skipped prefix width. skip/strwidth clobber x9, so persist the running budget on the stack like the x86_64 helper already does. 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_strimwidth()for AOT and Magician/eval, matching PHP 8.5 UTF-8 display-width trim semantics. Needed for Termwindtruncate/trimText.Behavior
mb_strimwidth(string $string, int $start, int $width, string $trim_marker = "", ?string $encoding = null): stringnull/UTF-8/UTF8trim by PHP 8.5 East Asian Width (width 2 in theeaw_table.hranges, otherwise 1).8bit/binary/7bittreat every byte as width 1.$startis a character offset; negative values count from the end.$width, it is cut and$trim_markeris appended. When the marker is at least as wide as the budget, PHP returns the marker alone.$start/$widthraise catchableValueError.mb_strimwidth(notmb_strwidthor othermb_*).Implementation
builtin!home.eval_builtin!with the same EAW table and trim algorithm.RuntimeFnId::MbStrimwidth→__rt_mb_strimwidthfor AArch64 and x86_64.Tests
ValueErrors.Docs
docs/php/strings.md,examples/string-ops,ROADMAP.md, generated builtin pages.