Skip to content

Variable $_SESSION in isset() always exists and is not nullable. #2791

@kubawerlos

Description

@kubawerlos

Bug report

PHPStan - PHP Static Analysis Tool 0.12.3

I'm getting this error:

Variable $_SESSION in isset() always exists and is not nullable.

Code snippet that reproduces the problem

    function isSessionStarted()
    {
        return isset($_SESSION);
    }

https://phpstan.org/r/6233c27e-2ada-4e50-ab2c-15ad851bd740

Expected output

No error - $_SESSION is created when session_start is called, it does not "always exist": https://3v4l.org/0a8Ie

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions