Skip to content

Stdlib: extension_loaded('intl') phantom true — partial grapheme builtins register unloaded ext (ext/standard/info.c) #11472

Closed

Description

@PurHur

Category

stdlib · php-src-strict

Problem

extension_loaded('intl') and get_loaded_extensions() list intl even when the intl extension is not actually available (Zend reference in Docker reports false). User code that gates ICU/grapheme features on extension_loaded('intl') gets false positives; grapheme_strlen() is callable while Zend has no such function without ext/intl.

Same pattern may affect other logical extensions registered via ModuleRegistry before full ext parity (see also zip phantom in #3337).

php-src reference

Repro

test/repro-maintainer/parity_extension_loaded_intl_phantom.php:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro-maintainer/parity_extension_loaded_intl_phantom.php
php bin/vm.php test/repro-maintainer/parity_extension_loaded_intl_phantom.php
'
Engine Result
Zend PHP 8.2 (no ext/intl) ok
VM FAIL extension_loaded(intl)=true … grapheme_strlen exists=true

Scope (PHP-in-PHP)

Layer Path
Extension registry ext/standard/ModuleRegistry.php, ext/standard/VmInfo.php
intl module ext/intl/Module.php — only register intl when module is fully loaded, or split grapheme stubs behind function_exists without advertising ext
Capability matrix script/capability-matrix.php if grapheme stays VM-only

Do not add C runtime module tables; fix PHP module registration to match php-src extension_loaded semantics.

Done when

  • Repro prints ok on VM in environment without Zend intl
  • When intl builtins are provided, either full ext/intl is registered or functions live under standard without extension_loaded('intl')===true
  • get_extension_funcs('intl') matches php-src shape for loaded/unloaded states
  • Targeted compliance guard

Related

Activity

  1. added
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jun 25, 2026
  2. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #11472, #11015)

  3. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Merged in #11489. VM repro + compliance guard green: php bin/vm.php test/repro-maintainer/parity_extension_loaded_intl_phantom.php → ok; extension_loaded('intl')=0, grapheme_strlen still available.

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-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions