Skip to content

Incorrect error on strict comparison from php function stream_get_contents #13289

@delamotte-pierrick

Description

@delamotte-pierrick

Bug report

The stream_get_contents method is expected to return a string or false. However, PHPStan reports that a strict comparison === false after calling this function will always evaluate to false, as if the false case were not possible.

Code snippet that reproduces the problem

https://phpstan.org/r/6ea137c6-96e7-4f8f-9d2f-e36b20022b49

Expected output

I should not have any error

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

Always ! I made a previous report on a bug and it was fixed and that help me to make my code more robuste.

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