Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on first class callable as conditional do while #12246

Open
samsonasik opened this issue Dec 11, 2024 · 4 comments · May be fixed by phpstan/phpstan-src#3752
Open

crash on first class callable as conditional do while #12246

samsonasik opened this issue Dec 11, 2024 · 4 comments · May be fixed by phpstan/phpstan-src#3752
Labels
Milestone

Comments

@samsonasik
Copy link

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

@phpstan-bot
Copy link
Contributor

@samsonasik After the latest push in 2.1.x, PHPStan now reports different result with your code snippet:

@@ @@
--1: Call to undefined method PHPStan\Node\Printer\Printer::pPHPStan_Node_MethodCallableNode()
+No errors

@samsonasik
Copy link
Author

@phpstan-bot
Copy link
Contributor

@samsonasik After the latest push in 2.1.x, PHPStan now reports different result with your code snippet:

@@ @@
--1: Call to undefined method PHPStan\Node\Printer\Printer::pPHPStan_Node_MethodCallableNode()
+No errors

@samsonasik
Copy link
Author

it is not, is the website up to date with phpstan bot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants