Constructor args are not checked in new $class(...)
when the $class
is class-string
#12010
Labels
new $class(...)
when the $class
is class-string
#12010
Bug report
Seems the code like
new $class(...);
are not checked at all when the$class
isclass-string
.Code snippet that reproduces the problem
https://phpstan.org/r/89e868a6-b4dc-4927-b855-8b547ae748df
Expected output
The "Parameter #1 $i of class A constructor expects int, string given." for
class-string<class>
. Something likeUnsafe usage of new ...
forclass-string<interface>
(when no__constructor()
signature).Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: