On Mon, Apr 20, 2020 at 8:52 AM Larry Garfield <la...@garfieldtech.com>
wrote:

> On Mon, Apr 20, 2020, at 6:17 AM, Dan Ackroyd wrote:
> > Here is an RFC for adding a 'mixed' type to the language:
> > https://wiki.php.net/rfc/mixed_type_v2
> >
>
> I am not against this, but now that we have Union types what places are
> there where the currently available type declarations are insufficient?
> Resource seems like the only remaining gap where you'd be forced to use
> `mixed` instead of a union.
>
> I imagine some type combinations get pretty wide. Like, this is verbose AF.

null|bool|int|float|string|array|object|resource

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.

-Sara

Reply via email to