Skip to content

crash on first class callable as conditional do while #12246

@samsonasik

Description

@samsonasik

Bug report

given code:

final class SkipFirstClassCallableInDo
{
    public function getSubscribedEvents()
    {
        do {

        } while ($this->textElement(...));
    }

    public function textElement()
    {
         return 1;
    }
}

it cause crash:

Call to undefined method PHPStan\Node\Printer\Printer::pPHPStan_Node_MethodCallableNode()

Code snippet that reproduces the problem

https://phpstan.org/r/178ac73a-e99c-4961-957f-a3c6062d7c44

Expected output

it should not crash.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions