Skip to content

Incorrect type analysis in some rare circumstances #15151

Closed

Description

@claudepache

Bug report

Hi,

Since PHPStan 2.2.10, I am experiencing random incorrect type analysis in rare places; the bug seems more consistent (i.e, less random) in PHP 2.2.12. I have managed to prepare a minimal reproducer: see linked repo.

Code snippet that reproduces the problem

https://github.com/claudepache/phpstan-bug-type

Expected output

The two dumped types should be mixed. No other errors.

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

No response

Activity

  1. mergeable commented on Sep 1, 2026

    @mergeable

    This bug report is missing a link to reproduction at phpstan.org/try.

    It will most likely be closed after manual review.

  2. claudepache commented on Sep 1, 2026

    @claudepache
    Author

    Additional note. I am able to reproduce the bug with a version of PHPStan installed via composer, but not directly from the source. A possible difference might be the presence of the turbo extension, but I have not dug further.

    EDIT: I confirm that the presence of the turbo extension makes a difference (the bug is triggered when the turbo extension is enabled).

  3. staabm commented on Sep 2, 2026

    @staabm
    Contributor

    @ondrejmirtes this is also a recent regression we should consider for a short term release

  4. ondrejmirtes commented on Sep 2, 2026

    @ondrejmirtes
    Member

    I'm also working on this one

  5. phpstan-bot commented on Sep 2, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#6355

  6. github-actions commented on Oct 4, 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 Oct 4, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions