Skip to content

php-in-php: phpversion($extension) — must resolve registered ext/* modules (zip, spl, filter, …) (ext/standard/info.c) #6372

Description

@PurHur

Category

stdlib · php-in-php · bootstrap

Problem

phpversion($extension) and extension_loaded($extension) read a hard-coded two-entry list in ext/standard/VmInfo.php (LOADED_EXTENSIONS = ['standard', 'types']).

Compiled modules under ext/*/ (zip, spl, filter, bcmath, mbstring, intl, session) register classes/functions but do not appear in extension introspection:

Probe Today (vm.php)
extension_loaded('zip') false while class_exists('ZipArchive') is true
phpversion('zip') false
extension_loaded('spl') false while class_exists('ArrayObject') is true

Parent issue #4839 tracks get_loaded_extensions() full registry; this issue is the phpversion() / extension_loaded() consumer slice workers can land incrementally.

php-src reference

Repro (today)

<?php
var_export(extension_loaded('zip'));
echo "\n";
var_export(class_exists('ZipArchive'));
echo "\n";
var_export(phpversion('zip'));
echo "\n";
var_export(phpversion('standard'));
echo "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php'

Scope (this repo)

Layer Files
Registry ext/standard/VmInfo.php — build extension name set from Runtime module list / ext/*/Module.php
Builtins extension_loaded.php, phpversion() helper
JIT lib/JIT/Builtin/Type/JitInfo.php
Tests extend test/compliance/cases/stdlib/extension_loaded.phpt

PHP-in-PHP: derive registry in PHP; delete any duplicate hard-coded tables in C when present.

Done when

Labels

stdlib, php-in-php, bootstrap, implementation-ready

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