Repository navigation
Closed
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Description
Category
bootstrap · stdlib
Problem
Thumbnail and captcha code probes function_exists('imagecreate') / imagecreatetruecolor. Full GD parity is #3496 (open); there is no ext/gd/ module today — every probe returns false and bootstrap inventory cannot register the extension surface.
Follow #5869 (zip skeleton) / #7406 (xml skeleton): add ext/gd/Module.php with stub builtins that throw catchable Error pointing to #3496, enabling parallel worker tracks without internal_* shims in ext/standard/.
php-src reference
- php/php-src
ext/gd/gd.c—PHP_FUNCTION(imagecreate), resource registration - php/php-src
ext/gd/php_gd.h— GD module init
Repro (today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(function_exists(\"imagecreate\")); echo PHP_EOL;"
ls ext/gd 2>/dev/null || echo no_ext_gd
'| Check | Zend (ext/gd) | VM today |
|---|---|---|
function_exists('imagecreate') |
true |
false ❌ |
ext/gd/Module.php |
n/a | missing ❌ |
Skeleton target:
<?php
try {
imagecreate(1, 1);
} catch (Throwable $e) {
echo get_class($e), ': ', $e->getMessage(), "\n";
}Scope (this repo)
| Path | Work |
|---|---|
ext/gd/Module.php, ext/gd/BuiltinClasses.php |
Register GD resource stub + imagecreate/imagecreatetruecolor throw stubs |
Module loader + script/bootstrap-inventory.php |
Include ext/gd/* |
| Tests | test/compliance/cases/stdlib/gd_skeleton_stub.phpt |
PHP-in-PHP: stubs in ext/gd/*.php; libgd/png only via thin FFI when #3496 implements real drawing.
Done when
-
function_exists('imagecreate')→trueon VM - Call throws catchable exception referencing Stdlib: ext/gd — imagecreate / imagepng baseline (ext/gd/gd.c parity) #3496
-
php script/bootstrap-inventory.php --checklistsext/gd/ -
./script/ci-fast.sh --filter gd_skeletongreen
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter gd_skeleton'Related
- Stdlib: ext/gd — imagecreate / imagepng baseline (ext/gd/gd.c parity) #3496 GD baseline · Stdlib: imageline()/imagestring()/imagechar()/imagefilledrectangle() — GD draw primitives missing (ext/gd/gd.c) #6534 draw primitives · Bootstrap: ext/zip/ module skeleton — register ZipArchive for self-host (M4) #5869 zip skeleton · Bootstrap: ext/xml module skeleton — xml_parser_create() must Error cleanly until #3494 #7406 xml skeleton · Epic: Self-host critical path — compiler compiles itself (M3→M5) #1492
Metadata
Metadata
Assignees
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Activity
PurHur commentedon Jun 7, 2026
claim: worker-lane-c — starting this run
Add ext/gd module skeleton with imagecreate stubs (#7407). (#7479)
PurHur commentedon Jun 7, 2026
Merged via #7479.
Verification:
function_exists('imagecreate')→trueon VMimagecreate(1, 1)throws catchableError: imagecreate() is not implemented in this compiler build (issue #3496)extension_loaded('gd')→truevendor/bin/phpunit --filter gd_skeleton→ OK (2 tests)php script/bootstrap-inventory.php --check→ OK 1725/1725 (listsext/gd/*)PHP-in-PHP: stubs in
ext/gd/*.php; noruntime/*.cgrowth.