Re: Adding "numeric" type hint
| From: | Levi Morrison | Date: | Thu, 30 Apr 2015 14:35:59 +0000 |
| Subject: | Re: Adding "numeric" type hint | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86095@lists.php.net to get a copy of this message | ||
This numeric type is a type of int or float. There is a formal name
for such types: union types. Some languages have syntax for union
types that would look like this: int | float. I have a draft RFC for
this subject: https://wiki.php.net/rfc/union_types. Union types
would
be useful for other common cases as well, such as
Foo | null or
array | Traversable.