Re: [RFC] Mixed type
| From: | Guilliam Xavier | Date: | Mon, 20 Apr 2020 15:59:02 +0000 |
| Subject: | Re: [RFC] Mixed type | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109723@lists.php.net to get a copy of this message | ||
On Mon, Apr 20, 2020 at 4:15 PM Sara Golemon <pollita@php.net> wrote:
>
> For the long term good of the language I'd prefer type aliases (or typedefs
> or usings or whatever you want to call them.
>
> use mixed = null|bool|int|float|string|array|object|resource;
> use scalar = null|bool|int|float|string;
> use number = int|float;
>
> That said, baking 'mixed' in as an implicit alias of the above isn't
> problematic for that future.
The
scalar example should be bool|int|float|string, without
null.
And for mixed, as already said, we cannot use resource in union types.
All the more reason to standardize those "aliases" in core?
--
Guilliam Xavier