Skip to content

Incorrect function signature for stream_bucket_new for PHP < 8? #6027

@mind-bending-forks

Description

@mind-bending-forks

Bug report

PHPStan reports that stream_bucket_new returns a resource for PHP < 8. Correct me if I'm wrong, but based on my experience and according to the docs (which admittedly come with a health warning that they are not up to date), it doesn't. It returns an object (just like it does for PHP >= 8).

Code snippet that reproduces the problem

https://phpstan.org/r/7c15e36b-0ea5-4ef9-b3a7-7503df901189

Expected output

No errors for PHP < 8.0, since PHPStan understands that it returns an object.

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

Yes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions