Skip to content

Regression: extension_loaded('gmp') + gmp_* callable on default profile — Zend false (ext/gmp) #22860

Description

@PurHur

Category

Stdlib · php-src-strict · extension advertisement (re-shape of #22791 / #22790; gmp surface already landed via #3341+)

Problem

Host Zend without ext/gmp reports extension_loaded('gmp') false and function_exists('gmp_add') false. The VM always advertises gmp and executes gmp_add successfully on the default/reference profile.

GMP APIs themselves are largely implemented (#3341 and follow-ups). This ticket is the introspection / default-profile gate so extension_loaded / function_exists match Zend when gmp is not part of the reference build.

Probed 2026-07-24 (host PHP 8.2.32, gmp absent).

Repro Zend 8.2+ (no gmp) VM (2026-07-24)
extension_loaded('gmp') false true
function_exists('gmp_add') false true
gmp_strval(gmp_add('2','3')) undefined function 5

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'php test/repro/extension_loaded_gmp_phantom.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/extension_loaded_gmp_phantom.php'

Done when

  • Default/reference profile without gmp: extension_loaded('gmp') and function_exists('gmp_add') are false
  • With gmp enabled for the profile/build: both true and gmp_add still works
  • Compliance .phpt under test/compliance/cases/
  • php-src-strict; no php-compiler-strict shortcut

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-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