Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Coalescing Assignment Operator: Variable is never used #268

Open
mlocati opened this issue Feb 8, 2024 · 0 comments
Open

Null Coalescing Assignment Operator: Variable is never used #268

mlocati opened this issue Feb 8, 2024 · 0 comments
Labels

Comments

@mlocati
Copy link
Contributor

mlocati commented Feb 8, 2024

Consider this code:

function foo(): Bar
{
    static $baz;

    return $baz ??= new Bar();
}

PDT signals that $baz is never used:

immagine

@mlocati mlocati added the bug label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant