← All docs

mb_strlen() — internals

Compiler internals for mb_strlen(): lowering path, type checks, and runtime helpers.

mb_strlen() — internals

Where it lives

Lowering notes

  • Lowers mb_strlen(string, encoding = null) through the multibyte runtime helper.
  • Omitted/null encodings use a null pointer plus zero length; explicit names stay byte strings for PHP-compatible case-insensitive lookup and ValueError handling.

Runtime helpers

The following runtime helpers are referenced:

  • __rt_mb_strlen

Signature summary

function mb_strlen(string $string, string $encoding = null): int

What the type checker enforces

  • Arity: takes 1–2 arguments (1 optional).

Eval interpreter (magician)

Cross-references