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
First-class callable error since PHPStan 1.8.3 #8078
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
As I wrote above, the error is not triggered in the PHPStan playground. 🤷♂️ |
duplicate of #8072 |
Not sure if that is correct. The error message in #8072 is
but the error message here is
|
@leofeyer I can only fix it with a reproduction. If you can't reproduce it on the playground, please create a small repository where it crashes the same way. Thanks. |
@leofeyer check my comments there. It kind of explains why the error differs. It should indeed be the same since the error is environment dependent |
Sure: https://github.com/leofeyer/phpstan-8078 Strangely enough, the issue does not occur in the Github Actions runner. However, if I run Then I guess it is a problem on my system (iMac M1 with macOS 12.6). Sorry for the noise. |
I can reproduce the error on my Macbook Pro 16" (M1, macOS 12.6, PHP 8.1.10 (cli) (built: Sep 3 2022 12:09:27) (NTS)) as well. |
It seems to be a Mac ARM issue as it does not occur on Windows, Ubuntu and the @herndlm Does it make sense to reopen the issue or do you still think that #8072 will fix it? |
I have an ARM Mac and I can reproduce the issue in your repo 🎉 |
BTW by looking at it I don't think it's OS-specific issue, it's just that PHP has to be configured to throw exceptions on |
Ah, good point. 👍 |
Fixed: phpstan/phpstan-src@6cd3d5d |
Thank you @ondrejmirtes! |
👍 yeah the assert behaviour is what I meant with environment specific. The explanation was not good, I'm currently travelling 😅 Great that Ondřej could fix it so fast! |
Thank you 🥳 |
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. |
Bug report
Since PHPStan 1.8.3, we are getting an error when trying to analyze a class with a first-class callable.
Code snippet that reproduces the problem
Note that the error is not triggered in the PHPStan playground.
Stack trace
It does work with PHPStan 1.8.2, so maybe it is related to phpstan/phpstan-src#1628?
The text was updated successfully, but these errors were encountered: