Skip to content

Uncaught TypeError: PHPStan\Analyser\MutatingScope::getType() #8072

@gitomato

Description

@gitomato

Bug report

Local PHPStan version: 1.8.6

First class callable function with Closures can make PHPStan crash.

Code snippet that reproduces the problem

Here is the smallest snippet I could write to reproduce:
https://phpstan.org/r/af6aa44b-8fff-4f75-ae92-f9f27f3d2f63

Notice the superfluous first class callable.

The PHP script executes normally and produces:

Hi

Expected output

Here is a fixed snippet:
https://phpstan.org/r/18fa015e-7218-49ae-b7a2-9e7acd51f810

The same OK result is expected for previous snippet.

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

PHPStan helps me at each new release and I'm happy to discover how it catches new things in my codebase and improves quality.

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