Skip to content

Parameter #4 $params of function stream_filter_append expects array, int given. #6802

@ppshobi

Description

@ppshobi

Bug report

the following function accepts amixed $params.

function stream_filter_append($stream, string $filter_name, int $mode, mixed $params) {}

but getting the following error

Parameter #4 $params of function stream_filter_append expects array, int given.

Code snippet that reproduces the problem


$csvStream = \fopen('php://memory', 'w+');
if (!$csvStream) {
   throw new RuntimeException('Failed to open CSV memory stream');
}
fputcsv($csvStream, ["a",2,"c"]);
rewind($csvStream);
stream_filter_append($csvStream, 'zlib.deflate', STREAM_FILTER_WRITE, -1);

https://phpstan.org/r/bcfb9f4b-0a8d-4c97-8fb1-e50172c3c341

Expected output

No, Errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions