-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
self::class
in parameter on trait method
#4066
Comments
Wow, didn't know such thing is possible... Runtime proof: https://3v4l.org/P7Bmd |
@ondrejmirtes Yeah, took me some time to debug it throughout our application :) But finally found the line! we learn something new each day ;) |
Interesting reflection behaviour that I'll need to replicate: https://3v4l.org/iopRK |
@olivernybroe After the latest commit to dev-master, PHPStan now reports different result with your code snippet: @@ @@
-1: Internal error: Failed to find parent class of constant "class".
Run PHPStan with --debug option and post the stack trace to:
-https://github.com/phpstan/phpstan/issues/new
+https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md Full report
|
@olivernybroe After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
--1: Internal error: Failed to find parent class of constant "class".
-Run PHPStan with --debug option and post the stack trace to:
-https://github.com/phpstan/phpstan/issues/new
+ 7: Parameter $date of method HelloWorld::sayHello() has invalid typehint type DateTimeImutable. Full report
|
Amazing! Thanks |
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
Phpstan crashes when using a trait that has a method with a parameter that refers to
self::class
Code snippet that reproduces the problem
https://phpstan.org/r/bddbfc71-bae5-49a2-9d64-0472e559781b
Expected output
That it doesn't crash ;)
The text was updated successfully, but these errors were encountered: