On Mon, Apr 20, 2020 at 4:15 PM Sara Golemon <poll...@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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to