Skip to content

Stdlib: withhold gd advertisement without host php-gd (#22740)#22757

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-22740-gd-phantom
Jul 24, 2026
Merged

Stdlib: withhold gd advertisement without host php-gd (#22740)#22757
PurHur merged 1 commit into
masterfrom
agent/stdlib-22740-gd-phantom

Conversation

@PurHur

@PurHur PurHur commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #22740

php-src reference

  • ext/gd/gd.c — module init gates image* / gd_info
  • ext/standard/info.cextension_loaded / module registry

PHP implementation

  • ext/gd/GdExtensionPolicy.php — host-extension advertisement gate (+ compliance helpers)
  • ext/gd/Module.php — still under standard; getAdditionalExtensionNames() driven by policy

Test plan

  • Docker (Zend gd=0):
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_HELPER_RUNTIME_O=1
php test/repro/gd_extension_loaded_phantom.php
php bin/vm.php test/repro/gd_extension_loaded_phantom.php
php bin/compile.php -o /tmp/gd_phantom_aot test/repro/gd_extension_loaded_phantom.php
/tmp/gd_phantom_aot
php vendor/bin/phpunit --filter "GdExtensionPolicyTest|GdModuleSkeletonTest|extension_loaded_gd_phantom|ImagecreatefromstringTest"'

Zend/VM/AOT all:

loaded=no
gd_info=no
imagecreate=no
in_list=no
funcs=no

PHPUnit: OK (6 tests, 1 skip when host lacks gd)

Gate probe (this run)

Gate Status
inventory (release-readiness) ok
release-readiness red — first fail north-star5-fast / 4f-m gen-0 manifest (#22642; not this PR)
issue repro VM+AOT green

Made with Cursor

Gate GdExtensionPolicy on extension_loaded('gd') so Docker images without
php-gd no longer phantom-register gd_info/imagecreate (re-#11675 / #6215).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: extension_loaded('gd') / gd_info() / imagecreate() phantom true (re-#11675, ext/gd)

1 participant