Re: Re: Alias for `int|float`
| From: | Hamza Ahmad | Date: | Thu, 29 Sep 2022 03:08:42 +0000 |
| Subject: | Re: Re: Alias for `int|float` | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118701@lists.php.net to get a copy of this message | ||
Hi Olle,
I appreciate your idea of introducing a similar concept of typedef.
What if you write an RFC explaining that concept. I can join you
however in co-authoring this request.
Seriously, I have had issues with writing such type again and again.
If you look at mixed type, it is indeed an alias of some union types.
Adding such an option to userland would lead to introduction of
various type hints. Plus, it will help devs write short hand aliases
for their intersection types.
Regards
Ahmad
On 9/27/22, Olle Härstedt <olleharstedt@gmail.com> wrote:
>>Hello, internals!
>>
>>What do you think about creating shorthand
number for
>>int|float?
>
> This is also related to allow all types of type-hints in the use-statement,
> like
>
> use int|float as numeric;
>
> Anyone interested in creating an RFC for this?
>
> Olle
>
> PS. Original thread here:
> https://externals.io/message/112209#112209
> (dunno how to respond to an old thread when I don't have the original
> message)
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>