Skip to content

Bootstrap: ext/mbstring/ module skeleton — register mbstring builtins for self-host (M4) #5695

Description

@PurHur

Category

bootstrap | stdlib

Problem

Open mbstring parity issues (#4405 mb_strlen, #3239 mb_substr, #3075 mb_convert_encoding, …) assume an ext/mbstring/ entry point like php-src, but this repo only has ext/standard + ext/types. mb_* helpers are absent from ext/standard/Module.php; there is no ext/mbstring/Module.php and no bootstrap inventory path for mbstring.

Self-host (#1492) needs a single module registration surface before individual mb builtins land.

php-src reference

Repro (failure today)

ls -d ext/mbstring 2>&1 || echo "missing ext/mbstring"
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php -r "var_export(function_exists(\"mb_strlen\")); echo PHP_EOL;"'
# Zend: true — VM: false
Runtime function_exists('mb_strlen')
Zend PHP 8.2 (Docker) true
bin/vm.php false

Scope (this repo)

Area Path
New module ext/mbstring/Module.php
Loader Wire next to ext/standard/Module.php in runtime module init
v1 Register stub mb_strlen (or delegate to strlen with documented gap) so function_exists + inventory include the module
Inventory script/bootstrap-inventory.php lists ext/mbstring/*
Follow-ups Real algorithms in #4405, #3239, etc. — not this issue

Done when

  • ext/mbstring/Module.php loads on VM without Zend PHP
  • function_exists('mb_strlen') is true (implementation may be minimal stub documented in issue body)
  • php script/bootstrap-inventory.php --check includes mbstring paths
  • ./script/ci-fast.sh --filter mbstring green for skeleton registration test

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions