Phpstan: `self::class` in parameter on trait method

Created on 10 Nov 2020  路  3Comments  路  Source: phpstan/phpstan

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 ;)

bug

All 3 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

Was this page helpful?
0 / 5 - 0 ratings