You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected error when using ReflectionClass::newInstance() #15032
As can be seen in below's code snippet, using ReflectionObject::newInstance() (inherited from ReflectionClass::newInstance()) with a template type leads to an error:
Function should return T of object but returns object
I wouldn't expect an error here, because the reflection was done on a specific object. Calling newInstance should return a new instance of this exact class (or fail).
Did PHPStan help you today? Did it make you happy in any way?
Activity
ondrejmirtes commentedon Jul 31, 2026
We don't have a stub for ReflectionObject at all, should be added.
github-actions commentedon Sep 1, 2026
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.