Skip to content

\ob_get_level() is not recognized as impure #12577

@dtdesign

Description

@dtdesign

Bug report

The \ob_get_level() reports the current depth of the output buffer and it therefore classifies as an impure function.

Code snippet that reproduces the problem

https://phpstan.org/r/9afc0573-09e4-405f-bd32-1c44d6d0752e

Expected output

Currently it appears to be recognized as pure which is an issue for the code snippet in the reproducer. The snippet may look strange because I have omitted some parts from the condition because we will only flush the output buffer in that place if there are errors.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions