Skip to content

Regression: zip_open Reflection filename OK but named filename rejected (ext/zip/php_zip.stub.php) #24666

Description

@PurHur

Category

bug · php-src-strict · named arguments · ext/zip · PHP_COMPILER_PROFILE=8.4

Problem

Under PROFILE=8.4, zip_open() Reflection already reports Zend's filename, and positional zip_open("/no/such.zip") returns false, but zip_open(filename: …) still throws Unknown named parameter $filename — classic BuiltinParamNames gap (same class as #23786 get_html_translation_table). Probed 2026-07-29, VM @ acd38db4c.

Repro (PHP_COMPILER_PROFILE=8.4) Zend / php-src VM (2026-07-29)
Reflection params filename filename
zip_open("/no/such.zip") false / resource false
zip_open(filename: "/no/such.zip") false / resource Unknown named parameter $filename

php-src reference

PHP implementation target

  • lib/BuiltinParamNames.phpzip_open['filename'] (and siblings zip_read / zip_entry_* if same gap)
  • ext/zip/*.php only if registration bypasses the map
  • PHP-in-PHP only; no new runtime/ C

Repro

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r '\''
$n=[]; foreach ((new ReflectionFunction("zip_open"))->getParameters() as $p) $n[]=$p->getName();
echo "params=", implode(",", $n), "\n";
echo "pos=", var_export(@zip_open("/no/such.zip"), true), "\n";
try { var_export(zip_open(filename: "/no/such.zip")); }
catch (Throwable $e) { echo $e->getMessage(), "\n"; }
'\'''

Done when

  • zip_open(filename: …) matches positional semantics
  • Unit guard covering named + Reflection
  • 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