It is common (with DI systems for example) and to my knowledge not particularly discouraged to have function parameters that are supposed to accept something like Foo::class, which currently is a string.
It seems logical to ask for a special type that can hold class names, so that parameters that can accept a class name can be type hinted more specifically than just (any) "string". Regardless of whether or not such a proposal would be accepted or declined (for complexity reasons maybe) I couldn't even find any such proposal. Has this really never been asked? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php