RFC: Introduce a class-string type
- Version: 0.3
- Last Substantial Updates: 2022-05-04
- Target Version: PHP 8.next
There are many scenarios in which userland code might need to pass parameters to a method or assign a value to a property that is intended to represent a
class. Currently the only way to type-hint that a provided value represents a fully-qualified class-name (FQCN) is through userland code. This RFC proposes adding a new internal type that would verify provided values are FQCN.