Skip to content

Bootstrap: ext/random module skeleton — register Random\\Randomizer before handlers (phase 0 of #3722) #7102

Description

@PurHur

Category

bootstrap | stdlib

Problem

#3722 tracks full Random\Randomizer + Random\Engine\* parity. Workers cannot land handlers incrementally while class_exists('Random\\Randomizer') is false and extension_loaded('random') is false — same blocker pattern as #7033 (igbinary), #7032 (msgpack), #6837 (ctype).

Verified 2026-06-06:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "
var_export(class_exists(\"Random\\\\Randomizer\")); echo PHP_EOL;
var_export(extension_loaded(\"random\")); echo PHP_EOL;
"'
# bool(false) bool(false)

random_bytes() / random_int() exist in ext/standard/ but the ext/random OOP surface is absent.

php-src reference

Repro

<?php
echo class_exists('Random\\Randomizer') ? 'yes' : 'no', "\n";
echo extension_loaded('random') ? 'yes' : 'no', "\n";
Runtime Random\Randomizer extension_loaded('random')
Zend PHP 8.2+ yes yes
bin/vm.php no no

Scope (phase 0 only)

Path Work
ext/random/Module.php (new) Register module + class entries for Randomizer, Random\Engine\Mt19937, exception stubs
Stub methods call() throws consistent Error until #3722 implements behavior
Runtime load Wire module in bootstrap spine like ext/filter
Tests test/unit/RandomModuleSkeletonTest.php
Matrix script/capability-matrix.php rows (VM yes, JIT deferred)

PHP-in-PHP: classes + handlers in ext/random/*.php; no C builtins.

Done when

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter RandomModuleSkeleton'

Related

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