Skip to content

Does not warn about non-nullable class-property #14393

Closed

Description

@MacGritsch

Bug report

I think phpstan could warn that the null-coalescing-operator makes no sense in this code.

Code snippet that reproduces the problem

https://phpstan.org/r/12d977e4-7125-4507-a31b-cc92dca2353f

Expected output

Property MyClass::$i (int) on left side of ?? is not nullable.

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

No response

Activity

  1. added a commit that references this issue on Mar 29, 2026
    d282a5f
  2. added 2 commits that reference this issue on Mar 30, 2026
    c8f1820
    2f58f5f
  3. phpstan-bot commented on Mar 30, 2026

    @phpstan-bot
    Collaborator

    Closed via merging phpstan/phpstan-src#5327

  4. added 2 commits that reference this issue on Mar 30, 2026
    0cfd9b0
    7b73e0a
  5. added a commit that references this issue on Apr 7, 2026
    ebb1d40
  6. github-actions commented on May 1, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  7. locked as resolved and limited conversation to collaborators on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions