Skip to content

CURLOPT_POSTFIELDS accepts also an array #8053

@voku

Description

@voku

Bug report

CURLOPT_POSTFIELDS accepts also an array not only empty-string.

"The full data to post in a HTTP "POST" operation. This parameter can either be passed as a urlencoded string like 'para1=val1&para2=val2&...' or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. Files can be sent using CURLFile or CURLStringFile, in which case value must be an array." - https://www.php.net/manual/en/function.curl-setopt.php

Code snippet that reproduces the problem

https://phpstan.org/r/db599e65-dfae-4e85-90bc-6bc96feadf96

Expected output

no error

Did PHPStan help you today? Did it make you happy in any way?

Verified some curl options today 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions