> Another (minor) issue I have with the RFC is the introduction of > ReflectionNamedType. A simpler alternative appears to be to add the > getName() method to ReflectionType; for unnamed types this could simply > return (string) $reflectionType. That might not be the most farsighted > design decision, though.
The problem is that if something such as union types or intersection types does pass those types are not named. While the current iteration of union types failed it is possible a future RFC can pass (for the record the vote was 11-18). > To add to this, another issue we discussed OTR but didn't really come to a > conclusion on, is the handling of self and parent type hints by > ReflectionClassType. The implementation I have will return ReflectionNamedType for self and parent. There isn't any special casing for it. Rather since we forbid defining types with these names they won't exist when the check happens and it will fall back to ReflectionNamedType. As pointed out these cannot always be resolved because of traits so this behavior seems sensible. I think the RFC should be amended to specify this behavior. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php