Skip to content

Regression: extension_loaded('curl')/function_exists('curl_init') phantom — Zend ext/curl absent (ext/curl/interface.c) #23953

Description

@PurHur

Category

stdlib · php-src-strict · extension advertisement

Problem

CurlExtensionPolicy::advertisesExtension() returns VmCurlNative::available() (libcurl FFI present). On php-compiler:22.04-dev, Zend does not load ext/curl, but the VM still reports the module and curl_init because FFI is available — introspection must follow Zend module registration, not host library presence (#23857 pattern; curl policy comments already warn about phantom class_exists).

Probe (2026-07-27, docker) Zend 8.2 VM
extension_loaded('curl') false true
function_exists('curl_init') false true

php-src reference

PHP implementation target

  • ext/curl/CurlExtensionPolicy.php — gate advertisement to match Zend’s loaded-module set on the reference profile (not “libcurl FFI exists”)
  • ext/standard/BuiltinIntrospectionPolicy.php — curl branch already special-cased; keep consistent
  • Keep in-tree curl implementations for builds that intentionally enable the module; PHP-in-PHP only

Repro

./script/docker-exec.sh -- bash -lc 'php -r "var_export(extension_loaded(\"curl\")); echo PHP_EOL; var_export(function_exists(\"curl_init\")); echo PHP_EOL;"'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r "var_export(extension_loaded(\"curl\")); echo PHP_EOL; var_export(function_exists(\"curl_init\")); echo PHP_EOL;"'

Done when

  • Default reference profile: curl extension / curl_init advertisement matches Zend
  • Existing CurlExtensionPolicyTest / phantom guards updated for the harness case
  • php-src-strict; no php-compiler-strict shortcut

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 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