RE: [PHP-DEV] Re: Improving PHP's type system
| From: | Thomas Punt | Date: | Sun, 17 Apr 2016 12:35:23 +0000 |
| Subject: | RE: [PHP-DEV] Re: Improving PHP's type system | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92382@lists.php.net to get a copy of this message | ||
Hi!
>> Just a quick thought.
>>
>>
>> union Iterable {
>> use array;
>> use ArrayAccess;
>> use Traversable;
>> }
>>
>
> I think this example creates another meaning on the "use" syntax, which
> make "use" context depended.
>
> The "use" statement is already used to "create an class name alias in the
> current namespace." and this makes "use" confusing.
I don't think this additional usage of "use" makes it any more confusing.
Many keywords are reused elsewhere, including "use":
- namespace importing
- variable importing for closures
- trait importing
(Ditto with "as.")
Thanks,
Tom