Skip to content

Regression: stream_filter_append/prepend Reflection filtername/read_write/filterparams + resource return — Zend filter_name/mode/params untyped (ext/standard/basic_functions.stub.php) #28908

Description

@PurHur

Category

bug · php-src-strict · Reflection / named args · pillar 4

Problem

stream_filter_append / stream_filter_prepend advertise wrong parameter names and a typed resource return. Zend uses filter_name / mode / params with no return type; named filter_name: works on Zend and is rejected on VM (Unknown named parameter $filter_name).

Verified 2026-08-08 on master @ b4d18ee79a via ./script/docker-exec.sh (host Zend 8.2.32).

Repro Zend 8.2+ VM
param names stream, filter_name, mode, params stream, filtername, read_write, filterparams
return type none resource
stream_filter_append(stream:$fp, filter_name:"string.toupper") OK Error: Unknown named parameter $filter_name

Same shape for stream_filter_prepend.

php-src reference

PHP implementation target

  • Fix Reflection / BuiltinParamNames (or ext metadata) for both builtins to Zend names + untyped return
  • PHP-in-PHP; no new runtime/*.c logic

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''
$fp=fopen("php://memory","r+");
$r=new ReflectionFunction("stream_filter_append");
foreach ($r->getParameters() as $p) echo $p->getName(), "\n";
echo "ret=", $r->hasReturnType() ? (string)$r->getReturnType() : "(none)", "\n";
try { stream_filter_append(stream:$fp, filter_name:"string.toupper"); echo "named_ok\n"; }
catch (Throwable $e) { echo get_class($e), ": ", $e->getMessage(), "\n"; }
'\'''

Done when

  • Reflection param names + return match Zend for append and prepend
  • Named filter_name: / mode: / params: accepted
  • Compliance/repro guard; php-src-strict; no php-compiler-strict shortcut

Maintainer gate snapshot (2026-08-08)

  • inventory OK 7240/7240; user_release_ready: yes

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