I have a variable with my classname
$var = Foo::class;
How can I use this var in type hinting in Main class?
Type hinting here is necessary for me and i cant put interface instead of class
class Main {
// use type in variable $var
private Foo $one;
}
Try some ways, but no success
New contributor
svintsoff is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.