Skip to content

False positive argument.type (… expects Foo<string|null>, Foo<string|null> given.) #10698

Closed

Description

@gharlan

Bug report

With Bleeding Edge and level 5-7 there is a weird error message for the given code:

Parameter #1 $foo of static method Bar::qux() expects Foo<string|null>, Foo<string|null> given.

With level 8/9 the error disappears.

Code snippet that reproduces the problem

https://phpstan.org/r/4b2b137e-e272-466e-96ff-a954af066387

Expected output

No error.

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

No response

Activity

  1. added this to the Easy fixes milestone on May 30, 2024
  2. VincentLanglet commented on Aug 2, 2025

    @VincentLanglet
    Contributor

    Same issue than #9096 (comment)

  3. added a commit that references this issue on Feb 12, 2026
    4b1d5dc
  4. phpstan-bot commented on Sep 10, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#6392

  5. github-actions commented on Oct 12, 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.

  6. locked as resolved and limited conversation to collaborators on Oct 12, 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

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions