Skip to content

feat: implement mb_strlen() builtin (UTF-8 code-point count)#466

Open
chadmandoo wants to merge 2 commits into
illegalstudio:mainfrom
chadmandoo:upstream-pr/mb-strlen
Open

feat: implement mb_strlen() builtin (UTF-8 code-point count)#466
chadmandoo wants to merge 2 commits into
illegalstudio:mainfrom
chadmandoo:upstream-pr/mb-strlen

Conversation

@chadmandoo

Copy link
Copy Markdown
Contributor

Implements mb_strlen() via the builtin registry with a UTF-8 code-point-counting runtime helper (continuation bytes don't count). Second commit excludes it from the runtime callable-wrapper dispatch table — it is registry/EIR-only with no frozen legacy-backend emitter, so a deferred-closure wrapper would emit an unresolved _fn_mb_u_strlen reference (same rationale as the serialize/unserialize exclusions). Byte-parity vs PHP 8.5 (ASCII / multibyte / empty / CJK) + regression test.

chadmandoo added a commit to chadmandoo/elephc that referenced this pull request Jul 10, 2026
Cherry-picked our illegalstudio#466 mb_strlen (UTF-8 code-point count) + fixed the
codegen_ir→codegen module rename for the EIR refactor. (Skipped the native
callable-dispatch-exclusion commit — callable_dispatch.rs was restructured;
not needed for the --check survey; follow-up for native codegen.) Survey 72→73%.
@chadmandoo chadmandoo force-pushed the upstream-pr/mb-strlen branch from ee747fa to e707596 Compare July 11, 2026 13:57
@github-actions github-actions Bot added area:builtins Touches PHP builtin declarations or emitters. area:codegen Touches target-aware assembly or backend lowering. area:runtime Touches runtime helpers, GC, ownership, or bridge runtimes. size:s Small pull request. type:feature Introduces new user-visible behavior or capabilities. labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:builtins Touches PHP builtin declarations or emitters. area:codegen Touches target-aware assembly or backend lowering. area:runtime Touches runtime helpers, GC, ownership, or bridge runtimes. size:s Small pull request. type:feature Introduces new user-visible behavior or capabilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant